|
2 | 2 |
|
3 | 3 | namespace CleanArchitecture.Web.Infrastructure; |
4 | 4 |
|
5 | | -public static class IEndpointRouteBuilderExtensions |
| 5 | +public static class EndpointRouteBuilderExtensions |
6 | 6 | { |
7 | | - public static IEndpointRouteBuilder MapGet(this IEndpointRouteBuilder builder, Delegate handler, [StringSyntax("Route")] string pattern = "") |
| 7 | + public static RouteHandlerBuilder MapGet(this IEndpointRouteBuilder builder, Delegate handler, [StringSyntax("Route")] string pattern = "") |
8 | 8 | { |
9 | 9 | Guard.Against.AnonymousMethod(handler); |
10 | 10 |
|
11 | | - builder.MapGet(pattern, handler) |
12 | | - .WithName(handler.Method.Name); |
13 | | - |
14 | | - return builder; |
| 11 | + return builder.MapGet(pattern, handler) |
| 12 | + .WithName(handler.Method.Name); |
15 | 13 | } |
16 | 14 |
|
17 | | - public static IEndpointRouteBuilder MapPost(this IEndpointRouteBuilder builder, Delegate handler, [StringSyntax("Route")] string pattern = "") |
| 15 | + public static RouteHandlerBuilder MapPost(this IEndpointRouteBuilder builder, Delegate handler, [StringSyntax("Route")] string pattern = "") |
18 | 16 | { |
19 | 17 | Guard.Against.AnonymousMethod(handler); |
20 | 18 |
|
21 | | - builder.MapPost(pattern, handler) |
| 19 | + return builder.MapPost(pattern, handler) |
22 | 20 | .WithName(handler.Method.Name); |
23 | | - |
24 | | - return builder; |
25 | 21 | } |
26 | 22 |
|
27 | | - public static IEndpointRouteBuilder MapPut(this IEndpointRouteBuilder builder, Delegate handler, [StringSyntax("Route")] string pattern) |
| 23 | + public static RouteHandlerBuilder MapPut(this IEndpointRouteBuilder builder, Delegate handler, [StringSyntax("Route")] string pattern) |
28 | 24 | { |
29 | 25 | Guard.Against.AnonymousMethod(handler); |
30 | 26 |
|
31 | | - builder.MapPut(pattern, handler) |
| 27 | + return builder.MapPut(pattern, handler) |
32 | 28 | .WithName(handler.Method.Name); |
33 | | - |
34 | | - return builder; |
35 | 29 | } |
36 | 30 |
|
37 | | - public static IEndpointRouteBuilder MapDelete(this IEndpointRouteBuilder builder, Delegate handler, [StringSyntax("Route")] string pattern) |
| 31 | + public static RouteHandlerBuilder MapDelete(this IEndpointRouteBuilder builder, Delegate handler, [StringSyntax("Route")] string pattern) |
38 | 32 | { |
39 | 33 | Guard.Against.AnonymousMethod(handler); |
40 | 34 |
|
41 | | - builder.MapDelete(pattern, handler) |
| 35 | + return builder.MapDelete(pattern, handler) |
42 | 36 | .WithName(handler.Method.Name); |
43 | | - |
44 | | - return builder; |
45 | 37 | } |
46 | 38 | } |
0 commit comments