Skip to content

Commit

Permalink
[AOT] Add Http.Results RouteValueDictionary overloads (#46594)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK committed Feb 21, 2023
1 parent bec278e commit 0134f61
Show file tree
Hide file tree
Showing 10 changed files with 512 additions and 46 deletions.
4 changes: 2 additions & 2 deletions src/Http/Http.Results/src/AcceptedAtRoute.cs
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
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
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
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
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
Expand Up @@ -96,7 +96,7 @@ internal RedirectToRouteHttpResult(object? routeValues)
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(object? routeValues)
string? fragment)
{
RouteName = routeName;
RouteValues = routeValues;
RouteValues = routeValues ?? new RouteValueDictionary();
PreserveMethod = preserveMethod;
Permanent = permanent;
Fragment = fragment;
Expand All @@ -136,7 +136,7 @@ internal RedirectToRouteHttpResult(object? routeValues)
/// <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

0 comments on commit 0134f61

Please sign in to comment.