-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
40a4248
commit 8c45c33
Showing
85 changed files
with
1,208 additions
and
593 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 24 additions & 2 deletions
26
src/Immediate.Apis.Generators/ImmediateApisGenerator.Render.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
#pragma warning disable CS1591 | ||
|
||
namespace Microsoft.AspNetCore.Builder; | ||
|
||
public static partial class {{ assembly }}RoutesBuilder | ||
{ | ||
private static void Map{{ method.class_as_method_name }}Endpoint(IEndpointRouteBuilder app) | ||
{ | ||
var endpoint = app | ||
.{{ method.http_method }}( | ||
"{{ method.route }}", | ||
async ( | ||
[AsParameters] {{ method.parameter_type }} parameters, | ||
[FromServices] {{ method.class_name }}.Handler handler, | ||
CancellationToken token | ||
) => await handler.HandleAsync(parameters, token) | ||
); | ||
|
||
|
||
{{~ if method.allow_anonymous ~}} | ||
_ = endpoint.AllowAnonymous(); | ||
{{~ else if method.authorize ~}} | ||
_ = endpoint.RequireAuthorization({{ if !string.empty method.authorize_policy }}"{{ method.authorize_policy }}"{{ end }}) | ||
{{~ end ~}} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...MethodWithAllowAnonymousTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//HintName: RouteBuilder.Dummy_GetUsersQuery.g.cs | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
#pragma warning disable CS1591 | ||
|
||
namespace Microsoft.AspNetCore.Builder; | ||
|
||
public static partial class TestsRoutesBuilder | ||
{ | ||
private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) | ||
{ | ||
var endpoint = app | ||
.MapDelete( | ||
"/test", | ||
async ( | ||
[AsParameters] global::Dummy.GetUsersQuery.Query parameters, | ||
[FromServices] global::Dummy.GetUsersQuery.Handler handler, | ||
CancellationToken token | ||
) => await handler.HandleAsync(parameters, token) | ||
); | ||
|
||
|
||
_ = endpoint.AllowAnonymous(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.