Skip to content

define RouteValuesAddress .ToString () #39753

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 24 commits into from
Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4fce698
define RouteValuesAddress .ToString ()
yecril71pl Jan 25, 2022
340b37f
do not use Linq
yecril71pl Jan 25, 2022
da4085d
no, really, no not use Linq
yecril71pl Jan 25, 2022
b26cd86
using System.Collections.Immutable
yecril71pl Jan 25, 2022
0c7aad7
fix formatting
yecril71pl Jan 25, 2022
debdd5e
add RouteValuesAddress.ToString()
yecril71pl Jan 25, 2022
b310774
ToString() -> string!
yecril71pl Jan 25, 2022
01efeec
use Linq, change of mind
yecril71pl Jan 27, 2022
0145e6f
Update src/Http/Routing/src/PublicAPI.Shipped.txt
pranavkm Jan 28, 2022
4b642a6
Update src/Http/Routing/src/RouteValuesAddress.cs
pranavkm Jan 28, 2022
9b19e57
Update src/Http/Routing/src/RouteValuesAddress.cs
pranavkm Jan 28, 2022
bbc39fc
Update PublicAPI.Unshipped.txt
pranavkm Jan 28, 2022
425908e
Update PublicAPI.Unshipped.txt
pranavkm Jan 28, 2022
108bead
Update src/Http/Routing/src/RouteValuesAddress.cs
pranavkm Jan 28, 2022
627f70e
Update src/Http/Routing/src/RouteValuesAddress.cs
pranavkm Jan 28, 2022
9b85a8f
Update src/Http/Routing/src/RouteValuesAddress.cs
pranavkm Jan 28, 2022
6f6ba5f
cache ToString as asString
yecril71pl Jan 29, 2022
9023beb
fix formatting
yecril71pl Jan 29, 2022
49cae96
a lazy value must be defined in a constructor
yecril71pl Jan 29, 2022
3d79c12
a useless API comment for the constructor
yecril71pl Jan 29, 2022
29f43c8
fix formatting
yecril71pl Jan 29, 2022
ef43d90
make Lazy thread-unsafe
yecril71pl Jan 31, 2022
da994fd
Update RouteValuesAddress.cs
pranavkm Jan 31, 2022
ac9379e
Update src/Http/Routing/src/RouteValuesAddress.cs
pranavkm Feb 1, 2022
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
1 change: 1 addition & 0 deletions src/Http/Routing/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Microsoft.AspNetCore.Routing.RouteOptions.SetParameterPolicy(string! token, Syst
Microsoft.AspNetCore.Routing.RouteOptions.SetParameterPolicy<T>(string! token) -> void
static Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapPatch(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder! endpoints, string! pattern, System.Delegate! handler) -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder!
static Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapPatch(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder! endpoints, string! pattern, Microsoft.AspNetCore.Http.RequestDelegate! requestDelegate) -> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder!
override Microsoft.AspNetCore.Routing.RouteValuesAddress.ToString() -> string?
9 changes: 9 additions & 0 deletions src/Http/Routing/src/RouteValuesAddress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

#nullable enable

using System.Linq;
namespace Microsoft.AspNetCore.Routing;

/// <summary>
/// An address of route name and values.
/// </summary>
public class RouteValuesAddress
{
private string? _toString;
/// <summary>
/// Gets or sets the route name.
/// </summary>
Expand All @@ -24,4 +26,11 @@ public class RouteValuesAddress
/// Gets or sets ambient route values from the current HTTP request.
/// </summary>
public RouteValueDictionary? AmbientValues { get; set; }

/// <inheritdoc />
public override string? ToString()
{
_toString ??= $"{RouteName}({string.Join(',', ExplicitValues.Select(kv => $"{kv.Key}=[{kv.Value}]"))})";
return _toString;
}
}