342 instantiations of PathString
Diagnostics.EFCore.FunctionalTests (2)
IIS.Microbenchmarks (1)
InMemory.FunctionalTests (1)
Microsoft.AspNetCore.Authentication.Cookies (3)
Microsoft.AspNetCore.Authentication.Facebook (1)
Microsoft.AspNetCore.Authentication.Google (1)
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
Microsoft.AspNetCore.Authentication.OpenIdConnect (7)
Microsoft.AspNetCore.Authentication.Test (87)
Microsoft.AspNetCore.Authentication.Twitter (1)
Microsoft.AspNetCore.Diagnostics (4)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
Microsoft.AspNetCore.Hosting.Tests (2)
Microsoft.AspNetCore.Http (2)
Microsoft.AspNetCore.Http.Abstractions (11)
Microsoft.AspNetCore.Http.Abstractions.Tests (32)
Microsoft.AspNetCore.Http.Extensions (5)
Microsoft.AspNetCore.Http.Extensions.Tests (16)
Microsoft.AspNetCore.Http.Results (1)
Microsoft.AspNetCore.Http.Results.Tests (9)
Microsoft.AspNetCore.HttpLogging.Tests (3)
Microsoft.AspNetCore.HttpOverrides.Tests (1)
Microsoft.AspNetCore.Identity (2)
Microsoft.AspNetCore.Identity.InMemory.Test (11)
Microsoft.AspNetCore.Mvc.Core (2)
Microsoft.AspNetCore.Mvc.Core.Test (22)
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (6)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (4)
Microsoft.AspNetCore.Owin.Tests (2)
Microsoft.AspNetCore.Rewrite.Tests (3)
Microsoft.AspNetCore.Routing (1)
Microsoft.AspNetCore.Routing.Tests (23)
Microsoft.AspNetCore.Server.HttpSys (2)
Microsoft.AspNetCore.Server.IISIntegration (2)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
Microsoft.AspNetCore.Session.Tests (12)
Microsoft.AspNetCore.StaticFiles (6)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (2)
Microsoft.AspNetCore.StaticFiles.Tests (31)
Microsoft.AspNetCore.TestHost (3)
Microsoft.AspNetCore.TestHost.Tests (9)
SocialSample (4)
473 references to PathString
BasicWebSite (1)
CookiePolicySample (1)
Diagnostics.EFCore.FunctionalTests (1)
Identity.DefaultUI.WebSite (1)
IIS.Microbenchmarks (1)
InMemory.FunctionalTests (1)
InProcessWebSite (3)
LargeResponseApp (1)
Microsoft.AspNetCore.Authentication (6)
Microsoft.AspNetCore.Authentication.Abstractions (2)
Microsoft.AspNetCore.Authentication.Cookies (6)
Microsoft.AspNetCore.Authentication.Core (2)
Microsoft.AspNetCore.Authentication.OpenIdConnect (2)
Microsoft.AspNetCore.Authentication.Test (3)
Microsoft.AspNetCore.Authentication.WsFederation (2)
Microsoft.AspNetCore.Components.Server (1)
Microsoft.AspNetCore.Components.WebAssembly.Server (6)
Microsoft.AspNetCore.Diagnostics (6)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (5)
Microsoft.AspNetCore.Diagnostics.HealthChecks (8)
Builder\HealthCheckApplicationBuilderExtensions.cs (8)
34public static IApplicationBuilder UseHealthChecks(this IApplicationBuilder app, PathString path)
57public static IApplicationBuilder UseHealthChecks(this IApplicationBuilder app, PathString path, HealthCheckOptions options)
85public static IApplicationBuilder UseHealthChecks(this IApplicationBuilder app, PathString path, int port)
112public static IApplicationBuilder UseHealthChecks(this IApplicationBuilder app, PathString path, string port)
143public static IApplicationBuilder UseHealthChecks(this IApplicationBuilder app, PathString path, int port, HealthCheckOptions options)
169public static IApplicationBuilder UseHealthChecks(this IApplicationBuilder app, PathString path, string port, HealthCheckOptions options)
191private static void UseHealthChecksCore(IApplicationBuilder app, PathString path, int? port, object[] args)
225(c.Request.Path.StartsWithSegments(path, out var remaining) &&
Microsoft.AspNetCore.Hosting (1)
Microsoft.AspNetCore.Http (2)
Microsoft.AspNetCore.Http.Abstractions (89)
PathString.cs (74)
20public readonly struct PathString : IEquatable<PathString>
30public static readonly PathString Empty = new(string.Empty);
180public static PathString FromUriComponent(string uriComponent)
199public static PathString FromUriComponent(Uri uri)
211/// Determines whether the beginning of this <see cref="PathString"/> instance matches the specified <see cref="PathString"/>.
213/// <param name="other">The <see cref="PathString"/> to compare.</param>
216/// When the <paramref name="other"/> parameter contains a trailing slash, the <see cref="PathString"/> being checked
217/// must either exactly match or include a trailing slash. For instance, for a <see cref="PathString"/> of "/a/b",
219/// Whereas, a <see cref="PathString"/> of "/a//b/" will return <c>true</c> when compared with "/a/".
221public bool StartsWithSegments(PathString other)
227/// Determines whether the beginning of this <see cref="PathString"/> instance matches the specified <see cref="PathString"/> when compared
230/// <param name="other">The <see cref="PathString"/> to compare.</param>
231/// <param name="comparisonType">One of the enumeration values that determines how this <see cref="PathString"/> and value are compared.</param>
234/// When the <paramref name="other"/> parameter contains a trailing slash, the <see cref="PathString"/> being checked
235/// must either exactly match or include a trailing slash. For instance, for a <see cref="PathString"/> of "/a/b",
237/// Whereas, a <see cref="PathString"/> of "/a//b/" will return <c>true</c> when compared with "/a/".
239public bool StartsWithSegments(PathString other, StringComparison comparisonType)
251/// Determines whether the beginning of this <see cref="PathString"/> instance matches the specified <see cref="PathString"/> and returns
254/// <param name="other">The <see cref="PathString"/> to compare.</param>
258/// When the <paramref name="other"/> parameter contains a trailing slash, the <see cref="PathString"/> being checked
259/// must either exactly match or include a trailing slash. For instance, for a <see cref="PathString"/> of "/a/b",
261/// Whereas, a <see cref="PathString"/> of "/a//b/" will return <c>true</c> when compared with "/a/".
263public bool StartsWithSegments(PathString other, out PathString remaining)
269/// Determines whether the beginning of this <see cref="PathString"/> instance matches the specified <see cref="PathString"/> when compared
272/// <param name="other">The <see cref="PathString"/> to compare.</param>
273/// <param name="comparisonType">One of the enumeration values that determines how this <see cref="PathString"/> and value are compared.</param>
277/// When the <paramref name="other"/> parameter contains a trailing slash, the <see cref="PathString"/> being checked
278/// must either exactly match or include a trailing slash. For instance, for a <see cref="PathString"/> of "/a/b",
280/// Whereas, a <see cref="PathString"/> of "/a//b/" will return <c>true</c> when compared with "/a/".
282public bool StartsWithSegments(PathString other, StringComparison comparisonType, out PathString remaining)
299/// Determines whether the beginning of this <see cref="PathString"/> instance matches the specified <see cref="PathString"/> and returns
302/// <param name="other">The <see cref="PathString"/> to compare.</param>
307/// When the <paramref name="other"/> parameter contains a trailing slash, the <see cref="PathString"/> being checked
308/// must either exactly match or include a trailing slash. For instance, for a <see cref="PathString"/> of "/a/b",
310/// Whereas, a <see cref="PathString"/> of "/a//b/" will return <c>true</c> when compared with "/a/".
312public bool StartsWithSegments(PathString other, out PathString matched, out PathString remaining)
318/// Determines whether the beginning of this <see cref="PathString"/> instance matches the specified <see cref="PathString"/> when compared
321/// <param name="other">The <see cref="PathString"/> to compare.</param>
322/// <param name="comparisonType">One of the enumeration values that determines how this <see cref="PathString"/> and value are compared.</param>
327/// When the <paramref name="other"/> parameter contains a trailing slash, the <see cref="PathString"/> being checked
328/// must either exactly match or include a trailing slash. For instance, for a <see cref="PathString"/> of "/a/b",
330/// Whereas, a <see cref="PathString"/> of "/a//b/" will return <c>true</c> when compared with "/a/".
332public bool StartsWithSegments(PathString other, StringComparison comparisonType, out PathString matched, out PathString remaining)
354public PathString Add(PathString other)
383public bool Equals(PathString other)
394public bool Equals(PathString other, StringComparison comparisonType)
414return obj is PathString pathString && Equals(pathString);
432public static bool operator ==(PathString left, PathString right)
443public static bool operator !=(PathString left, PathString right)
453public static string operator +(string left, PathString right)
465public static string operator +(PathString left, string? right)
478public static PathString operator +(PathString left, PathString right)
489public static string operator +(PathString left, QueryString right)
498public static implicit operator PathString(string? s)
505public static implicit operator string(PathString path)
508internal static PathString ConvertFromString(string? s)
519? PathString.ConvertFromString(@string)
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (4)
Microsoft.AspNetCore.Http.Abstractions.Tests (74)
PathStringTests.cs (72)
23Assert.Equal(default(PathString), PathString.Empty);
24Assert.Equal(default(PathString), PathString.Empty);
25Assert.True(PathString.Empty == default(PathString));
26Assert.True(default(PathString) == PathString.Empty);
27Assert.True(PathString.Empty.Equals(default(PathString)));
28Assert.True(default(PathString).Equals(PathString.Empty));
35var pathString = new PathString("/hello");
38Assert.NotEqual(default(PathString), pathString);
45var pathString = new PathString("/hello");
48Assert.NotEqual(pathString, PathString.Empty);
54Assert.Equal(PathString.Empty.GetHashCode(), default(PathString).GetHashCode());
63var appPath = new PathString(appString);
64var concatPath = new PathString(concatString);
67var result = appPath.Add(concatPath);
83var appPath = new PathString(appString);
84var concatPath = new PathString(concatString);
87var result = appPath.Add(concatPath);
98var pathBase = new PathString("/base");
99var path = new PathString("/path");
121var source = new PathString(sourcePath);
122var test = new PathString(testPath);
137var source = new PathString(sourcePath);
138var test = new PathString(testPath);
153var source = new PathString(sourcePath);
154var test = new PathString(testPath);
156var result = source.StartsWithSegments(test, out var remaining);
169var source = new PathString(sourcePath);
170var test = new PathString(testPath);
172var result = source.StartsWithSegments(test, out var remaining);
190var source = new PathString(sourcePath);
191var test = new PathString(testPath);
211var source = new PathString(sourcePath);
212var test = new PathString(testPath);
232var source = new PathString(sourcePath);
233var test = new PathString(testPath);
235var result = source.StartsWithSegments(test, comparison, out var remaining);
253var source = new PathString(sourcePath);
254var test = new PathString(testPath);
256var result = source.StartsWithSegments(test, comparison, out var remaining);
284var path = new PathString(input);
292var converter = TypeDescriptor.GetConverter(typeof(PathString));
293PathString result = (PathString)converter.ConvertFromInvariantString("/foo")!;
307PathString p1 = "/?";
309PathString p2 = s1;
320var sut = PathString.FromUriComponent(input);
332var sut = PathString.FromUriComponent(uri);
342var sut = PathString.FromUriComponent(input);
353var sut = PathString.FromUriComponent(uri);
368var sut = PathString.FromUriComponent(input);
377var sut = PathString.FromUriComponent(input);
388var testString = new string('a', PathString.StackAllocThreshold + offset - path.Length);
389var sut = PathString.FromUriComponent(path + testString);
390Assert.Equal(PathString.StackAllocThreshold + offset, sut.Value!.Length);
400var testString = new string('a', PathString.StackAllocThreshold + offset);
401var sut = PathString.FromUriComponent(new Uri(localhost + testString));
402Assert.Equal(PathString.StackAllocThreshold + offset + 1, sut.Value!.Length);
Microsoft.AspNetCore.Http.Extensions (9)
UriHelper.cs (9)
31PathString pathBase = new PathString(),
32PathString path = new PathString(),
54PathString pathBase = new PathString(),
55PathString path = new PathString(),
109out PathString path,
146path = PathString.FromUriComponent(uri.Substring(searchIndex, limit - searchIndex));
168pathBase: PathString.FromUriComponent(uri),
242/// Initializes the URI <see cref="string"/> for <see cref="BuildAbsolute(string, HostString, PathString, PathString, QueryString, FragmentString)"/>.
Microsoft.AspNetCore.Http.Extensions.Tests (5)
Microsoft.AspNetCore.Http.Results (3)
Microsoft.AspNetCore.Http.Results.Tests (4)
TestLinkGenerator.cs (4)
13public override string GetPathByAddress<TAddress>(HttpContext httpContext, TAddress address, RouteValueDictionary values, RouteValueDictionary ambientValues = null, PathString? pathBase = null, FragmentString fragment = default, LinkOptions options = null)
18public override string GetPathByAddress<TAddress>(TAddress address, RouteValueDictionary values, PathString pathBase = default, FragmentString fragment = default, LinkOptions options = null)
23public override string GetUriByAddress<TAddress>(HttpContext httpContext, TAddress address, RouteValueDictionary values, RouteValueDictionary ambientValues = null, string scheme = null, HostString? host = null, PathString? pathBase = null, FragmentString fragment = default, LinkOptions options = null)
26public override string GetUriByAddress<TAddress>(TAddress address, RouteValueDictionary values, string scheme, HostString host, PathString pathBase = default, FragmentString fragment = default, LinkOptions options = null)
Microsoft.AspNetCore.HttpOverrides (1)
Microsoft.AspNetCore.HttpOverrides.Tests (3)
Microsoft.AspNetCore.Identity.InMemory.Test (1)
Microsoft.AspNetCore.Mvc.Core (17)
Microsoft.AspNetCore.Mvc.Core.Test (1)
Microsoft.AspNetCore.Mvc.Razor (1)
Microsoft.AspNetCore.Mvc.TagHelpers (7)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (47)
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
Microsoft.AspNetCore.Rewrite (18)
Microsoft.AspNetCore.Rewrite.Tests (1)
Microsoft.AspNetCore.Routing (41)
DefaultLinkGenerator.cs (8)
74PathString? pathBase = default,
99PathString pathBase = default,
126PathString? pathBase = default,
154PathString pathBase = default,
204PathString pathBase,
240PathString pathBase,
286out (PathString path, QueryString query) result)
354public static void TemplateSucceeded(ILogger logger, RouteEndpoint endpoint, PathString path, QueryString query)
Microsoft.AspNetCore.Routing.Abstractions (4)
Microsoft.AspNetCore.Routing.Tests (1)
Microsoft.AspNetCore.Server.HttpSys (2)
Microsoft.AspNetCore.Server.IISIntegration (3)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
Microsoft.AspNetCore.SpaServices.Extensions (2)
Microsoft.AspNetCore.StaticFiles (23)
StaticFileMiddleware.cs (6)
19private readonly PathString _matchUrl;
68else if (!ValidatePath(context, _matchUrl, out var subPath))
93internal static bool ValidatePath(HttpContext context, PathString matchUrl, out PathString subPath) => Helpers.TryMatchPath(context, matchUrl, forDirectory: false, out subPath);
95internal static bool LookupContentType(IContentTypeProvider contentTypeProvider, StaticFileOptions options, PathString subPath, out string? contentType)
111private Task TryServeStaticFile(HttpContext context, string? contentType, PathString subPath)
Microsoft.AspNetCore.StaticFiles.Tests (11)
StaticFileContextTest.cs (11)
21var pathString = PathString.Empty;
22var validateResult = StaticFileMiddleware.ValidatePath(httpContext, pathString, out var subPath);
45var pathString = new PathString("/test");
48var validateResult = StaticFileMiddleware.ValidatePath(httpContext, pathString, out var subPath);
71var pathString = new PathString("/test");
76var validateResult = StaticFileMiddleware.ValidatePath(httpContext, pathString, out var subPath);
100var pathString = new PathString("/test");
105var validateResult = StaticFileMiddleware.ValidatePath(httpContext, pathString, out var subPath);
127var pathString = new PathString("/test");
133var validateResult = StaticFileMiddleware.ValidatePath(httpContext, pathString, out var subPath);
Microsoft.AspNetCore.TestHost (18)
Microsoft.AspNetCore.TestHost.Tests (18)
ClientHandlerTests.cs (18)
202var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context =>
265var handler = new ClientHandler(PathString.Empty, new InspectingApplication(features =>
280var handler = new ClientHandler(PathString.Empty, new InspectingApplication(features =>
300var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context =>
338PathString.Empty,
351var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context =>
373var handler = new ClientHandler(PathString.Empty, new DummyApplication(context =>
387var handler = new ClientHandler(PathString.Empty, new DummyApplication(context =>
406var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context =>
425var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context =>
444var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context =>
466var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context =>
489var handler = new ClientHandler(PathString.Empty, new DummyApplication(context =>
511var handler = new ClientHandler(PathString.Empty, new DummyApplication(context =>
524var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context =>
543var handler = new ClientHandler(PathString.Empty, new DummyApplication(context =>
559var handler = new ClientHandler(PathString.Empty, new DummyApplication(context =>
575var handler = new ClientHandler(PathString.Empty, new DummyApplication(async context =>