-
-
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.
Endpoint Parameter Registration (#30)
* Change default registration for post/patch/put * Allow overrides of registration
- Loading branch information
1 parent
439b187
commit da88917
Showing
118 changed files
with
1,764 additions
and
34 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
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,54 @@ | ||
namespace Immediate.Apis.Shared; | ||
|
||
/// <summary> | ||
/// Common Registrations for use with <see cref="EndpointRegistrationOverrideAttribute"/>. | ||
/// </summary> | ||
public static class EndpointRegistration | ||
{ | ||
/// <summary> | ||
/// Use <c>[AsParameters]</c> as the registration | ||
/// </summary> | ||
public const string AsParameters = nameof(AsParameters); | ||
|
||
/// <summary> | ||
/// Use <c>[FromBody]</c> as the registration | ||
/// </summary> | ||
public const string FromBody = nameof(FromBody); | ||
|
||
/// <summary> | ||
/// Use <c>[FromForm]</c> as the registration | ||
/// </summary> | ||
public const string FromForm = nameof(FromForm); | ||
|
||
/// <summary> | ||
/// Use <c>[FromHeader]</c> as the registration | ||
/// </summary> | ||
public const string FromHeader = nameof(FromHeader); | ||
|
||
/// <summary> | ||
/// Use <c>[FromQuery]</c> as the registration | ||
/// </summary> | ||
public const string FromQuery = nameof(FromQuery); | ||
|
||
/// <summary> | ||
/// Use <c>[FromRoute]</c> as the registration | ||
/// </summary> | ||
public const string FromRoute = nameof(FromRoute); | ||
} | ||
|
||
/// <summary> | ||
/// Specify how the handler parameter should be registered with Minimal Apis | ||
/// </summary> | ||
/// <param name="registration"> | ||
/// The desired registration | ||
/// </param> | ||
[AttributeUsage(AttributeTargets.Class)] | ||
public sealed class EndpointRegistrationOverrideAttribute( | ||
string registration | ||
) : Attribute | ||
{ | ||
/// <summary> | ||
/// The desired registration | ||
/// </summary> | ||
public string Registration { get; } = registration; | ||
} |
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
1 change: 1 addition & 0 deletions
1
...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
1 change: 1 addition & 0 deletions
1
...MapMethodWithAllowAnonymousTest_method=Get#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
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
1 change: 1 addition & 0 deletions
1
...WithAuthorizeConstructorTest_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
1 change: 1 addition & 0 deletions
1
...hodWithAuthorizeConstructorTest_method=Get#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
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
1 change: 1 addition & 0 deletions
1
...orizeNamedPolicyArgumentTest_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
1 change: 1 addition & 0 deletions
1
...uthorizeNamedPolicyArgumentTest_method=Get#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
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
1 change: 1 addition & 0 deletions
1
...ethodWithSimpleAuthorizeTest_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
1 change: 1 addition & 0 deletions
1
...apMethodWithSimpleAuthorizeTest_method=Get#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
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
Oops, something went wrong.