Skip to content

Commit 0e3d59c

Browse files
committed
[AOT] Add Http.Results RouteValueDictionary overloads
1 parent c382c35 commit 0e3d59c

10 files changed

+512
-46
lines changed

src/Http/Http.Results/src/AcceptedAtRoute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ internal AcceptedAtRoute(string? routeName, object? routeValues)
5050
/// <param name="routeValues">The route data to use for generating the URL.</param>
5151
internal AcceptedAtRoute(
5252
string? routeName,
53-
RouteValueDictionary routeValues)
53+
RouteValueDictionary? routeValues)
5454
{
5555
RouteName = routeName;
56-
RouteValues = routeValues;
56+
RouteValues = routeValues ?? new RouteValueDictionary();
5757
}
5858

5959
/// <summary>

src/Http/Http.Results/src/AcceptedAtRouteOfT.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ internal AcceptedAtRoute(string? routeName, object? routeValues, TValue? value)
5454
/// <param name="value">The value to format in the entity body.</param>
5555
internal AcceptedAtRoute(
5656
string? routeName,
57-
RouteValueDictionary routeValues,
57+
RouteValueDictionary? routeValues,
5858
TValue? value)
5959
{
6060
Value = value;
6161
RouteName = routeName;
62-
RouteValues = routeValues;
62+
RouteValues = routeValues ?? new RouteValueDictionary();
6363
HttpResultsHelper.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
6464
}
6565

src/Http/Http.Results/src/CreatedAtRoute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ internal CreatedAtRoute(string? routeName, object? routeValues)
5050
/// <param name="routeValues">The route data to use for generating the URL.</param>
5151
internal CreatedAtRoute(
5252
string? routeName,
53-
RouteValueDictionary routeValues)
53+
RouteValueDictionary? routeValues)
5454
{
5555
RouteName = routeName;
56-
RouteValues = routeValues;
56+
RouteValues = routeValues ?? new RouteValueDictionary();
5757
}
5858

5959
/// <summary>

src/Http/Http.Results/src/CreatedAtRouteOfT.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ internal CreatedAtRoute(string? routeName, object? routeValues, TValue? value)
5454
/// <param name="value">The value to format in the entity body.</param>
5555
internal CreatedAtRoute(
5656
string? routeName,
57-
RouteValueDictionary routeValues,
57+
RouteValueDictionary? routeValues,
5858
TValue? value)
5959
{
6060
Value = value;
6161
RouteName = routeName;
62-
RouteValues = routeValues;
62+
RouteValues = routeValues ?? new RouteValueDictionary();
6363
HttpResultsHelper.ApplyProblemDetailsDefaultsIfNeeded(Value, StatusCode);
6464
}
6565

src/Http/Http.Results/src/PublicAPI.Unshipped.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,27 @@
44
*REMOVED*static Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult.Instance.get -> Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult!
55
Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult (forwarded, contained in Microsoft.AspNetCore.Http.Abstractions)
66
Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult.ExecuteAsync(Microsoft.AspNetCore.Http.HttpContext! httpContext) -> System.Threading.Tasks.Task! (forwarded, contained in Microsoft.AspNetCore.Http.Abstractions)
7+
Microsoft.AspNetCore.Http.HttpResults.RedirectToRouteHttpResult.RouteValues.get -> Microsoft.AspNetCore.Routing.RouteValueDictionary!
8+
*REMOVED*Microsoft.AspNetCore.Http.HttpResults.RedirectToRouteHttpResult.RouteValues.get -> Microsoft.AspNetCore.Routing.RouteValueDictionary?
79
static Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult.Instance.get -> Microsoft.AspNetCore.Http.HttpResults.EmptyHttpResult! (forwarded, contained in Microsoft.AspNetCore.Http.Abstractions)
10+
static Microsoft.AspNetCore.Http.Results.AcceptedAtRoute(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues, object? value = null) -> Microsoft.AspNetCore.Http.IResult!
11+
static Microsoft.AspNetCore.Http.Results.AcceptedAtRoute<TValue>(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues, TValue? value = default(TValue?)) -> Microsoft.AspNetCore.Http.IResult!
812
static Microsoft.AspNetCore.Http.Results.Created() -> Microsoft.AspNetCore.Http.IResult!
913
*REMOVED*static Microsoft.AspNetCore.Http.Results.Created(string! uri, object? value) -> Microsoft.AspNetCore.Http.IResult!
1014
*REMOVED*static Microsoft.AspNetCore.Http.Results.Created(System.Uri! uri, object? value) -> Microsoft.AspNetCore.Http.IResult!
1115
static Microsoft.AspNetCore.Http.Results.Created(string? uri, object? value) -> Microsoft.AspNetCore.Http.IResult!
1216
static Microsoft.AspNetCore.Http.Results.Created(System.Uri? uri, object? value) -> Microsoft.AspNetCore.Http.IResult!
1317
static Microsoft.AspNetCore.Http.Results.Created<TValue>(string? uri, TValue? value) -> Microsoft.AspNetCore.Http.IResult!
1418
static Microsoft.AspNetCore.Http.Results.Created<TValue>(System.Uri? uri, TValue? value) -> Microsoft.AspNetCore.Http.IResult!
19+
static Microsoft.AspNetCore.Http.Results.CreatedAtRoute(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues, object? value = null) -> Microsoft.AspNetCore.Http.IResult!
20+
static Microsoft.AspNetCore.Http.Results.CreatedAtRoute<TValue>(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues, TValue? value = default(TValue?)) -> Microsoft.AspNetCore.Http.IResult!
1521
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!
1622
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!
1723
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!
1824
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!
25+
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!
26+
static Microsoft.AspNetCore.Http.TypedResults.AcceptedAtRoute(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues) -> Microsoft.AspNetCore.Http.HttpResults.AcceptedAtRoute!
27+
static Microsoft.AspNetCore.Http.TypedResults.AcceptedAtRoute<TValue>(TValue? value, string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues) -> Microsoft.AspNetCore.Http.HttpResults.AcceptedAtRoute<TValue>!
1928
static Microsoft.AspNetCore.Http.TypedResults.Created() -> Microsoft.AspNetCore.Http.HttpResults.Created!
2029
static Microsoft.AspNetCore.Http.TypedResults.Created(string? uri) -> Microsoft.AspNetCore.Http.HttpResults.Created!
2130
static Microsoft.AspNetCore.Http.TypedResults.Created(System.Uri? uri) -> Microsoft.AspNetCore.Http.HttpResults.Created!
@@ -27,5 +36,8 @@ static Microsoft.AspNetCore.Http.TypedResults.Created<TValue>(System.Uri? uri, T
2736
*REMOVED*static Microsoft.AspNetCore.Http.TypedResults.Created(string! uri) -> Microsoft.AspNetCore.Http.HttpResults.Created!
2837
*REMOVED*static Microsoft.AspNetCore.Http.TypedResults.Created<TValue>(System.Uri! uri, TValue? value) -> Microsoft.AspNetCore.Http.HttpResults.Created<TValue>!
2938
*REMOVED*static Microsoft.AspNetCore.Http.TypedResults.Created<TValue>(string! uri, TValue? value) -> Microsoft.AspNetCore.Http.HttpResults.Created<TValue>!
39+
static Microsoft.AspNetCore.Http.TypedResults.CreatedAtRoute(string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues) -> Microsoft.AspNetCore.Http.HttpResults.CreatedAtRoute!
40+
static Microsoft.AspNetCore.Http.TypedResults.CreatedAtRoute<TValue>(TValue? value, string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues) -> Microsoft.AspNetCore.Http.HttpResults.CreatedAtRoute<TValue>!
3041
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>!
3142
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>!
43+
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!

src/Http/Http.Results/src/RedirectToRouteHttpResult.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ internal RedirectToRouteHttpResult(
9696
bool preserveMethod,
9797
string? fragment) : this(
9898
routeName,
99-
routeValues == null ? null : new RouteValueDictionary(routeValues),
99+
new RouteValueDictionary(routeValues),
100100
permanent,
101101
preserveMethod,
102102
fragment)
@@ -122,7 +122,7 @@ internal RedirectToRouteHttpResult(
122122
string? fragment)
123123
{
124124
RouteName = routeName;
125-
RouteValues = routeValues;
125+
RouteValues = routeValues ?? new RouteValueDictionary();
126126
PreserveMethod = preserveMethod;
127127
Permanent = permanent;
128128
Fragment = fragment;
@@ -136,7 +136,7 @@ internal RedirectToRouteHttpResult(
136136
/// <summary>
137137
/// Gets the route data to use for generating the URL.
138138
/// </summary>
139-
public RouteValueDictionary? RouteValues { get; }
139+
public RouteValueDictionary RouteValues { get; }
140140

141141
/// <summary>
142142
/// Gets the value that specifies that the redirect should be permanent if true or temporary if false.

0 commit comments

Comments
 (0)