Skip to content

[AOT] Add Http.Results RouteValueDictionary overloads #46594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Http/Http.Results/src/AcceptedAtRoute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ internal AcceptedAtRoute(string? routeName, object? routeValues)
/// <param name="routeValues">The route data to use for generating the URL.</param>
internal AcceptedAtRoute(
string? routeName,
RouteValueDictionary routeValues)
RouteValueDictionary? routeValues)
{
RouteName = routeName;
RouteValues = routeValues;
RouteValues = routeValues ?? new RouteValueDictionary();
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Http.Results/src/AcceptedAtRouteOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ internal AcceptedAtRoute(string? routeName, object? routeValues, TValue? value)
/// <param name="value">The value to format in the entity body.</param>
internal AcceptedAtRoute(
string? routeName,
RouteValueDictionary routeValues,
RouteValueDictionary? routeValues,
TValue? value)
{
Value = value;
RouteName = routeName;
RouteValues = routeValues;
RouteValues = routeValues ?? new RouteValueDictionary();
HttpResultsHelper.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Http/Http.Results/src/CreatedAtRoute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ internal CreatedAtRoute(string? routeName, object? routeValues)
/// <param name="routeValues">The route data to use for generating the URL.</param>
internal CreatedAtRoute(
string? routeName,
RouteValueDictionary routeValues)
RouteValueDictionary? routeValues)
{
RouteName = routeName;
RouteValues = routeValues;
RouteValues = routeValues ?? new RouteValueDictionary();
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Http.Results/src/CreatedAtRouteOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ internal CreatedAtRoute(string? routeName, object? routeValues, TValue? value)
/// <param name="value">The value to format in the entity body.</param>
internal CreatedAtRoute(
string? routeName,
RouteValueDictionary routeValues,
RouteValueDictionary? routeValues,
TValue? value)
{
Value = value;
RouteName = routeName;
RouteValues = routeValues;
RouteValues = routeValues ?? new RouteValueDictionary();
HttpResultsHelper.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
}

Expand Down
12 changes: 12 additions & 0 deletions src/Http/Http.Results/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,27 @@
*REMOVED*static Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult.Instance.get -> Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult!
Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult (forwarded, contained in Microsoft.AspNetCore.Http.Abstractions)
Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult.ExecuteAsync(Microsoft.AspNetCore.Http.HttpContext! httpContext) -> System.Threading.Tasks.Task! (forwarded, contained in Microsoft.AspNetCore.Http.Abstractions)
Microsoft.AspNetCore.Http.HttpResults.RedirectToRouteHttpResult.RouteValues.get -> Microsoft.AspNetCore.Routing.RouteValueDictionary!
*REMOVED*Microsoft.AspNetCore.Http.HttpResults.RedirectToRouteHttpResult.RouteValues.get -> Microsoft.AspNetCore.Routing.RouteValueDictionary?
static Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult.Instance.get -> Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult! (forwarded, contained in Microsoft.AspNetCore.Http.Abstractions)
static Microsoft.AspNetCore.Http.Results.AcceptedAtRoute(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues, object? value = null) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.Results.AcceptedAtRoute<TValue>(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues, TValue? value = default(TValue?)) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.Results.Created() -> Microsoft.AspNetCore.Http.IResult!
*REMOVED*static Microsoft.AspNetCore.Http.Results.Created(string! uri, object? value) -> Microsoft.AspNetCore.Http.IResult!
*REMOVED*static Microsoft.AspNetCore.Http.Results.Created(System.Uri! uri, object? value) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.Results.Created(string? uri, object? value) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.Results.Created(System.Uri? uri, object? value) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.Results.Created<TValue>(string? uri, TValue? value) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.Results.Created<TValue>(System.Uri? uri, TValue? value) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.Results.CreatedAtRoute(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues, object? value = null) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.Results.CreatedAtRoute<TValue>(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues, TValue? value = default(TValue?)) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.Results.Json(object? data, System.Text.Json.Serialization.Metadata.JsonTypeInfo! jsonTypeInfo, string? contentType = null, int? statusCode = null) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.Results.Json(object? data, System.Type! type, System.Text.Json.Serialization.JsonSerializerContext! context, string? contentType = null, int? statusCode = null) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.Results.Json<TValue>(TValue? data, System.Text.Json.Serialization.JsonSerializerContext! context, string? contentType = null, int? statusCode = null) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.Results.Json<TValue>(TValue? data, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue>! jsonTypeInfo, string? contentType = null, int? statusCode = null) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.Results.RedirectToRoute(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues, bool permanent = false, bool preserveMethod = false, string? fragment = null) -> Microsoft.AspNetCore.Http.IResult!
static Microsoft.AspNetCore.Http.TypedResults.AcceptedAtRoute(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues) -> Microsoft.AspNetCore.Http.HttpResults.AcceptedAtRoute!
static Microsoft.AspNetCore.Http.TypedResults.AcceptedAtRoute<TValue>(TValue? value, string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues) -> Microsoft.AspNetCore.Http.HttpResults.AcceptedAtRoute<TValue>!
static Microsoft.AspNetCore.Http.TypedResults.Created() -> Microsoft.AspNetCore.Http.HttpResults.Created!
static Microsoft.AspNetCore.Http.TypedResults.Created(string? uri) -> Microsoft.AspNetCore.Http.HttpResults.Created!
static Microsoft.AspNetCore.Http.TypedResults.Created(System.Uri? uri) -> Microsoft.AspNetCore.Http.HttpResults.Created!
Expand All @@ -27,5 +36,8 @@ static Microsoft.AspNetCore.Http.TypedResults.Created<TValue>(System.Uri? uri, T
*REMOVED*static Microsoft.AspNetCore.Http.TypedResults.Created(string! uri) -> Microsoft.AspNetCore.Http.HttpResults.Created!
*REMOVED*static Microsoft.AspNetCore.Http.TypedResults.Created<TValue>(System.Uri! uri, TValue? value) -> Microsoft.AspNetCore.Http.HttpResults.Created<TValue>!
*REMOVED*static Microsoft.AspNetCore.Http.TypedResults.Created<TValue>(string! uri, TValue? value) -> Microsoft.AspNetCore.Http.HttpResults.Created<TValue>!
static Microsoft.AspNetCore.Http.TypedResults.CreatedAtRoute(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues) -> Microsoft.AspNetCore.Http.HttpResults.CreatedAtRoute!
static Microsoft.AspNetCore.Http.TypedResults.CreatedAtRoute<TValue>(TValue? value, string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues) -> Microsoft.AspNetCore.Http.HttpResults.CreatedAtRoute<TValue>!
static Microsoft.AspNetCore.Http.TypedResults.Json<TValue>(TValue? data, System.Text.Json.Serialization.JsonSerializerContext! context, string? contentType = null, int? statusCode = null) -> Microsoft.AspNetCore.Http.HttpResults.JsonHttpResult<TValue>!
static Microsoft.AspNetCore.Http.TypedResults.Json<TValue>(TValue? data, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue>! jsonTypeInfo, string? contentType = null, int? statusCode = null) -> Microsoft.AspNetCore.Http.HttpResults.JsonHttpResult<TValue>!
static Microsoft.AspNetCore.Http.TypedResults.RedirectToRoute(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues, bool permanent = false, bool preserveMethod = false, string? fragment = null) -> Microsoft.AspNetCore.Http.HttpResults.RedirectToRouteHttpResult!
6 changes: 3 additions & 3 deletions src/Http/Http.Results/src/RedirectToRouteHttpResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ internal RedirectToRouteHttpResult(
bool preserveMethod,
string? fragment) : this(
routeName,
routeValues == null ? null : new RouteValueDictionary(routeValues),
new RouteValueDictionary(routeValues),
permanent,
preserveMethod,
fragment)
Expand All @@ -122,7 +122,7 @@ internal RedirectToRouteHttpResult(
string? fragment)
{
RouteName = routeName;
RouteValues = routeValues;
RouteValues = routeValues ?? new RouteValueDictionary();
PreserveMethod = preserveMethod;
Permanent = permanent;
Fragment = fragment;
Expand All @@ -136,7 +136,7 @@ internal RedirectToRouteHttpResult(
/// <summary>
/// Gets the route data to use for generating the URL.
/// </summary>
public RouteValueDictionary? RouteValues { get; }
public RouteValueDictionary RouteValues { get; }

/// <summary>
/// Gets the value that specifies that the redirect should be permanent if true or temporary if false.
Expand Down
Loading