Skip to content

Commit e95688e

Browse files
murshexcaptainsafia
authored andcommitted
Add route string syntax for pattern in RouteHandlerServices.Map (#59940)
1 parent 72a06de commit e95688e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Http/Routing/src/Builder/RouteHandlerServices.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System.ComponentModel;
5+
using System.Diagnostics.CodeAnalysis;
56
using System.Reflection;
67
using Microsoft.AspNetCore.Builder;
78
using Microsoft.AspNetCore.Http;
@@ -32,7 +33,7 @@ public static class RouteHandlerServices
3233
/// <returns>The <see cref="RouteHandlerBuilder"/>>.</returns>
3334
public static RouteHandlerBuilder Map(
3435
IEndpointRouteBuilder endpoints,
35-
string pattern,
36+
[StringSyntax("Route")] string pattern,
3637
Delegate handler,
3738
IEnumerable<string>? httpMethods,
3839
Func<MethodInfo, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult> populateMetadata,
@@ -62,7 +63,7 @@ public static RouteHandlerBuilder Map(
6263
/// <returns>The <see cref="RouteHandlerBuilder"/>>.</returns>
6364
public static RouteHandlerBuilder Map(
6465
IEndpointRouteBuilder endpoints,
65-
string pattern,
66+
[StringSyntax("Route")] string pattern,
6667
Delegate handler,
6768
IEnumerable<string>? httpMethods,
6869
Func<MethodInfo, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult> populateMetadata,

0 commit comments

Comments
 (0)