From 3f85600440f9298b5487224aba8e6c4e615bad5c Mon Sep 17 00:00:00 2001 From: Stuart Turner Date: Thu, 9 May 2024 10:53:07 -0500 Subject: [PATCH] Move Override specification to method parameter (#54) --- .editorconfig | 5 +- .../ITypeSymbolExtensions.cs | 37 ++++++++-- .../ImmediateApisGenerator.Models.cs | 10 ++- .../ImmediateApisGenerator.Transform.cs | 41 +++++++---- .../Templates/Route.sbntxt | 69 +++++++++++-------- src/Immediate.Apis.Generators/Utility.cs | 3 + .../EndpointRegistration.cs | 54 --------------- .../Features/WeatherForecast/Put.cs | 2 +- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 44 +++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- .../GeneratorTests/ParameterAttributeTests.cs | 24 +++++-- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...teBuilder.Dummy_GetUserQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...teBuilder.Dummy_GetUserQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...teBuilder.Dummy_GetUserQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...teBuilder.Dummy_GetUserQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...teBuilder.Dummy_GetUserQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- ...eBuilder.Dummy_GetUsersQuery.g.verified.cs | 42 ++++++----- 94 files changed, 2281 insertions(+), 1584 deletions(-) delete mode 100644 src/Immediate.Apis.Shared/EndpointRegistration.cs diff --git a/.editorconfig b/.editorconfig index 6beab33..c05dc16 100644 --- a/.editorconfig +++ b/.editorconfig @@ -300,8 +300,7 @@ dotnet_diagnostic.CA2007.severity = none # CA2007: Consider calli # Immediate.Handlers relies on nested types dotnet_diagnostic.CA1034.severity = none # CA1034: Nested types should not be visible -# No need for cryptographically secure anything in this project -dotnet_diagnostic.CA5394.severity = none # CA5394: Random is an insecure random number generator - # Dispose things need disposing dotnet_diagnostic.CA2000.severity = error # CA2000: Dispose objects before losing scope + +dotnet_diagnostic.CA1716.severity = none # CA1716: Identifiers should not match keywords diff --git a/src/Immediate.Apis.Generators/ITypeSymbolExtensions.cs b/src/Immediate.Apis.Generators/ITypeSymbolExtensions.cs index be63211..c31228c 100644 --- a/src/Immediate.Apis.Generators/ITypeSymbolExtensions.cs +++ b/src/Immediate.Apis.Generators/ITypeSymbolExtensions.cs @@ -1,3 +1,4 @@ +using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis; namespace Immediate.Apis.Generators; @@ -85,19 +86,45 @@ typeSymbol is INamedTypeSymbol }, }; - public static bool IsEndpointRegistrationOverrideAttribute(this ITypeSymbol? typeSymbol) => + public static bool IsBindingParameterAttribute([NotNullWhen(returnValue: true)] this ITypeSymbol? typeSymbol) => + typeSymbol.IsAsParametersAttribute() || typeSymbol.IsFromXxxAttribute(); + + public static bool IsAsParametersAttribute(this ITypeSymbol? typeSymbol) => + typeSymbol is INamedTypeSymbol + { + Name: "AsParametersAttribute", + ContainingNamespace: + { + Name: "Http", + ContainingNamespace: + { + Name: "AspNetCore", + ContainingNamespace: + { + Name: "Microsoft", + ContainingNamespace.IsGlobalNamespace: true, + }, + }, + }, + }; + + public static bool IsFromXxxAttribute(this ITypeSymbol? typeSymbol) => typeSymbol is INamedTypeSymbol { - Name: "EndpointRegistrationOverrideAttribute", + Name: "FromBodyAttribute" + or "FromFormAttribute" + or "FromHeaderAttribute" + or "FromQueryAttribute" + or "FromRouteAttribute", ContainingNamespace: { - Name: "Shared", + Name: "Mvc", ContainingNamespace: { - Name: "Apis", + Name: "AspNetCore", ContainingNamespace: { - Name: "Immediate", + Name: "Microsoft", ContainingNamespace.IsGlobalNamespace: true, }, }, diff --git a/src/Immediate.Apis.Generators/ImmediateApisGenerator.Models.cs b/src/Immediate.Apis.Generators/ImmediateApisGenerator.Models.cs index 4bb5dcb..47a53c1 100644 --- a/src/Immediate.Apis.Generators/ImmediateApisGenerator.Models.cs +++ b/src/Immediate.Apis.Generators/ImmediateApisGenerator.Models.cs @@ -8,7 +8,9 @@ private sealed record Method public required string ParameterAttribute { get; init; } public required string Route { get; init; } - public required string ClassName { get; init; } + public required string? Namespace { get; init; } + public required Class Class { get; init; } + public required string ClassFullName { get; init; } public required string ClassAsMethodName { get; init; } public required string ParameterType { get; init; } @@ -19,4 +21,10 @@ private sealed record Method public required bool UseCustomization { get; init; } public required bool UseTransformMethod { get; init; } } + + public sealed record Class + { + public required string Type { get; init; } + public required string Name { get; init; } + } } diff --git a/src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs b/src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs index 1543495..1d21d05 100644 --- a/src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs +++ b/src/Immediate.Apis.Generators/ImmediateApisGenerator.Transform.cs @@ -61,14 +61,15 @@ CancellationToken token token.ThrowIfCancellationRequested(); + var @namespace = symbol.ContainingNamespace.ToString().NullIf(""); + var @class = GetClass(symbol); var className = symbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); var classAsMethodName = symbol.ToString().Replace(".", "_"); - var parameterType = handleMethod.Parameters[0].Type - .ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + var parameterType = handleMethod.Parameters[0].Type; token.ThrowIfCancellationRequested(); - var parameterAttribute = GetParameterAttribute(handleMethod.Parameters[0].Type, httpMethod); + var parameterAttribute = GetParameterAttribute(handleMethod.Parameters[0], httpMethod); token.ThrowIfCancellationRequested(); @@ -86,9 +87,11 @@ CancellationToken token ParameterAttribute = parameterAttribute, Route = route, - ClassName = className, + Namespace = @namespace, + Class = @class, + ClassFullName = className, ClassAsMethodName = classAsMethodName, - ParameterType = parameterType, + ParameterType = parameterType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), AllowAnonymous = allowAnonymous, Authorize = authorize, @@ -165,21 +168,29 @@ m is && SymbolEqualityComparer.IncludeNullability.Equals(returnInnerType, paramType) ); - private static string GetParameterAttribute(ITypeSymbol parameterType, string httpMethod) - { - foreach (var a in parameterType.GetAttributes()) + private static Class GetClass(INamedTypeSymbol symbol) => + new() { - if (a.AttributeClass.IsEndpointRegistrationOverrideAttribute()) + Name = symbol.Name, + Type = symbol switch { - if (a.ConstructorArguments.Length != 0) - return (string)a.ConstructorArguments[0].Value!; + { TypeKind: TypeKind.Interface } => "interface", + { IsRecord: true, TypeKind: TypeKind.Struct, } => "record struct", + { IsRecord: true, } => "record", + { TypeKind: TypeKind.Struct, } => "struct", + _ => "class", + }, + }; - if (a.NamedArguments.Length != 0) - return (string)a.NamedArguments[0].Value.Value!; - } + private static string GetParameterAttribute(IParameterSymbol parameterSymbol, string httpMethod) + { + foreach (var a in parameterSymbol.GetAttributes()) + { + if (a.AttributeClass.IsBindingParameterAttribute()) + return a.AttributeClass.Name[..^9]; } - if (parameterType is INamedTypeSymbol typeSymbol) + if (parameterSymbol.Type is INamedTypeSymbol typeSymbol) { foreach (var p in typeSymbol.GetMembers().OfType()) { diff --git a/src/Immediate.Apis.Generators/Templates/Route.sbntxt b/src/Immediate.Apis.Generators/Templates/Route.sbntxt index 728978a..e21dfa0 100644 --- a/src/Immediate.Apis.Generators/Templates/Route.sbntxt +++ b/src/Immediate.Apis.Generators/Templates/Route.sbntxt @@ -3,39 +3,50 @@ using Microsoft.AspNetCore.Mvc; #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class {{ assembly }}RoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void Map{{ method.class_as_method_name }}Endpoint(IEndpointRouteBuilder app) + public static partial class {{ assembly }}RoutesBuilder { - var endpoint = app - .{{ method.http_method }}( - "{{ method.route }}", - async ( - [{{ method.parameter_attribute }}] {{ method.parameter_type }} parameters, - [FromServices] {{ method.class_name }}.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - {{~ if method.use_transform_method ~}} - return {{ method.class_name }}.TransformResult(ret); - {{~ else ~}} - return ret; - {{~ end ~}} - } - ); - {{~ if method.allow_anonymous ~}} + private static void Map{{ method.class_as_method_name }}Endpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .{{ method.http_method }}( + "{{ method.route }}", + async ( + [{{ method.parameter_attribute }}] {{ method.parameter_type }} parameters, + [FromServices] {{ method.class_full_name }}.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + {{~ if method.use_transform_method ~}} + return {{ method.class_full_name }}.TransformResult(ret); + {{~ else ~}} + return ret; + {{~ end ~}} + } + ); + {{~ if method.allow_anonymous ~}} - _ = endpoint.AllowAnonymous(); - {{~ else if method.authorize ~}} + _ = endpoint.AllowAnonymous(); + {{~ else if method.authorize ~}} - _ = endpoint.RequireAuthorization({{ if !string.empty method.authorize_policy }}"{{ method.authorize_policy }}"{{ end }}); - {{~ end ~}} - {{~ if method.use_customization ~}} + _ = endpoint.RequireAuthorization({{ if !string.empty method.authorize_policy }}"{{ method.authorize_policy }}"{{ end }}); + {{~ end ~}} + {{~ if method.use_customization ~}} - {{ method.class_name }}.CustomizeEndpoint(endpoint); - {{~ end ~}} + {{ method.class_full_name }}.CustomizeEndpoint(endpoint); + {{~ end ~}} + } } } + +{{ if method.namespace -}} +namespace {{ method.namespace }} +{ +{{ end }} + /// registered using [{{ method.parameter_attribute }}] + partial {{ method.class.type }} {{ method.class.name }}; +{{ if method.namespace -}} +} +{{ end -}} diff --git a/src/Immediate.Apis.Generators/Utility.cs b/src/Immediate.Apis.Generators/Utility.cs index 2c64cf4..7c2f0f1 100644 --- a/src/Immediate.Apis.Generators/Utility.cs +++ b/src/Immediate.Apis.Generators/Utility.cs @@ -16,4 +16,7 @@ public static Template GetTemplate(string name) using var reader = new StreamReader(stream); return Template.Parse(reader.ReadToEnd()); } + + public static string? NullIf(this string value, string check) => + value.Equals(check, StringComparison.Ordinal) ? null : value; } diff --git a/src/Immediate.Apis.Shared/EndpointRegistration.cs b/src/Immediate.Apis.Shared/EndpointRegistration.cs deleted file mode 100644 index a01464d..0000000 --- a/src/Immediate.Apis.Shared/EndpointRegistration.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace Immediate.Apis.Shared; - -/// -/// Common Registrations for use with . -/// -public static class EndpointRegistration -{ - /// - /// Use [AsParameters] as the registration - /// - public const string AsParameters = nameof(AsParameters); - - /// - /// Use [FromBody] as the registration - /// - public const string FromBody = nameof(FromBody); - - /// - /// Use [FromForm] as the registration - /// - public const string FromForm = nameof(FromForm); - - /// - /// Use [FromHeader] as the registration - /// - public const string FromHeader = nameof(FromHeader); - - /// - /// Use [FromQuery] as the registration - /// - public const string FromQuery = nameof(FromQuery); - - /// - /// Use [FromRoute] as the registration - /// - public const string FromRoute = nameof(FromRoute); -} - -/// -/// Specify how the handler parameter should be registered with Minimal Apis -/// -/// -/// The desired registration -/// -[AttributeUsage(AttributeTargets.Class)] -public sealed class EndpointRegistrationOverrideAttribute( - string registration -) : Attribute -{ - /// - /// The desired registration - /// - public string Registration { get; } = registration; -} diff --git a/tests/Immediate.Apis.FunctionalTests/Features/WeatherForecast/Put.cs b/tests/Immediate.Apis.FunctionalTests/Features/WeatherForecast/Put.cs index fff6763..e4cc847 100644 --- a/tests/Immediate.Apis.FunctionalTests/Features/WeatherForecast/Put.cs +++ b/tests/Immediate.Apis.FunctionalTests/Features/WeatherForecast/Put.cs @@ -9,7 +9,6 @@ namespace Immediate.Apis.FunctionalTests.Features.WeatherForecast; [Authorize("Test")] public static partial class Put { - [EndpointRegistrationOverride(EndpointRegistration.AsParameters)] public sealed record Command { public required DateOnly Date { get; init; } @@ -19,6 +18,7 @@ public sealed record Command } private static async ValueTask Handle( + [AsParameters] Command _, CancellationToken token ) diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 9a412c1..4da4a00 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + 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 + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.AllowAnonymous(); + _ = endpoint.AllowAnonymous(); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index b0d3bb0..1999b6e 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [AsParameters] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.AllowAnonymous(); + _ = endpoint.AllowAnonymous(); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 34ea2f7..91ccb53 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.AllowAnonymous(); + _ = endpoint.AllowAnonymous(); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 7c882ac..9e05cb8 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.AllowAnonymous(); + _ = endpoint.AllowAnonymous(); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index ad2cd47..d017dcc 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAllowAnonymousTests.MapMethodWithAllowAnonymousTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.AllowAnonymous(); + _ = endpoint.AllowAnonymous(); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 293b025..18c79f8 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + 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 + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization("TestPolicy"); + _ = endpoint.RequireAuthorization("TestPolicy"); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index d02dd14..f1a833c 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [AsParameters] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization("TestPolicy"); + _ = endpoint.RequireAuthorization("TestPolicy"); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 4bca25c..8062662 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization("TestPolicy"); + _ = endpoint.RequireAuthorization("TestPolicy"); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 77419f6..85c8bbe 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization("TestPolicy"); + _ = endpoint.RequireAuthorization("TestPolicy"); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 25c0f24..ee9b4ff 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeConstructorTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization("TestPolicy"); + _ = endpoint.RequireAuthorization("TestPolicy"); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 293b025..18c79f8 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + 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 + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization("TestPolicy"); + _ = endpoint.RequireAuthorization("TestPolicy"); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index d02dd14..f1a833c 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [AsParameters] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization("TestPolicy"); + _ = endpoint.RequireAuthorization("TestPolicy"); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 4bca25c..8062662 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization("TestPolicy"); + _ = endpoint.RequireAuthorization("TestPolicy"); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 77419f6..85c8bbe 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization("TestPolicy"); + _ = endpoint.RequireAuthorization("TestPolicy"); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 25c0f24..ee9b4ff 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithAuthorizeNamedPolicyArgumentTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization("TestPolicy"); + _ = endpoint.RequireAuthorization("TestPolicy"); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 4f94fba..11b3c9b 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + 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 + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization(); + _ = endpoint.RequireAuthorization(); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index ecc4365..f75d983 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [AsParameters] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization(); + _ = endpoint.RequireAuthorization(); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 70419b1..b5f0eee 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization(); + _ = endpoint.RequireAuthorization(); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index c2a25af..73f544b 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization(); + _ = endpoint.RequireAuthorization(); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 188dd5e..8a2c1ef 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ApiAuthorizeTests.MapMethodWithSimpleAuthorizeTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - _ = endpoint.RequireAuthorization(); + _ = endpoint.RequireAuthorization(); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 9ba848c..eb667af 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + 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 + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - global::Dummy.GetUsersQuery.CustomizeEndpoint(endpoint); + global::Dummy.GetUsersQuery.CustomizeEndpoint(endpoint); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 73bda40..e72b1fb 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [AsParameters] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - global::Dummy.GetUsersQuery.CustomizeEndpoint(endpoint); + global::Dummy.GetUsersQuery.CustomizeEndpoint(endpoint); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index ed884fa..e3f44ca 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - global::Dummy.GetUsersQuery.CustomizeEndpoint(endpoint); + global::Dummy.GetUsersQuery.CustomizeEndpoint(endpoint); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 02e6029..7de57db 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - global::Dummy.GetUsersQuery.CustomizeEndpoint(endpoint); + global::Dummy.GetUsersQuery.CustomizeEndpoint(endpoint); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index ae983b9..8428f5f 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/CustomizeEndpointsTests.MapMethodCustomizeEndpointTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,26 +4,34 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); - global::Dummy.GetUsersQuery.CustomizeEndpoint(endpoint); + global::Dummy.GetUsersQuery.CustomizeEndpoint(endpoint); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 81ad6f5..4f40ce9 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + 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 + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 13fd28c..df3dd75 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [AsParameters] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 6fe9be0..f72c3a9 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [AsParameters] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index bbe6f34..4c3986b 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [AsParameters] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index cca637e..814b24d 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.AsParametersTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [AsParameters] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index a07b36c..b3df507 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapDelete( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 75cd2ee..98e2f37 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index fcc77b8..11d10c6 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 90c41c7..19d457b 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index d3f5dbe..416b303 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromBodyTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 12df23f..960ccd8 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [FromForm] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapDelete( + "/test", + async ( + [FromForm] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromForm] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 07ba309..b5f6560 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [FromForm] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [FromForm] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromForm] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index b36d7af..eaf8c43 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromForm] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromForm] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromForm] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 7cf8bed..14270ce 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromForm] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromForm] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromForm] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index c34fa93..c4856d2 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromFormTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromForm] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromForm] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromForm] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 81ad6f5..485849f 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapDelete( + "/test", + async ( + [FromHeader] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromHeader] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 13fd28c..5017c9b 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [FromHeader] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromHeader] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index fcc77b8..8991a43 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromHeader] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromHeader] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 90c41c7..a176012 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromHeader] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromHeader] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index d3f5dbe..343d934 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromHeaderTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromHeader] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromHeader] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 0557fac..dd7c534 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [FromQuery] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapDelete( + "/test", + async ( + [FromQuery] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromQuery] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index c31f4f0..e5cf4f5 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [FromQuery] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [FromQuery] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromQuery] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 8a45532..9580adb 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromQuery] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromQuery] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromQuery] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 07d4219..fe9beb1 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromQuery] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromQuery] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromQuery] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 471a81f..d7c7335 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromQueryTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromQuery] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromQuery] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromQuery] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index d1de591..e91b23e 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [FromRoute] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapDelete( + "/test", + async ( + [FromRoute] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromRoute] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 358ddb1..1461923 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [FromRoute] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [FromRoute] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromRoute] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index c0dd15c..ea024e2 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromRoute] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromRoute] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromRoute] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index da5d06b..4675984 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromRoute] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromRoute] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromRoute] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index afc20d6..2d62ac4 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.FromRouteTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromRoute] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromRoute] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromRoute] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 12df23f..960ccd8 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [FromForm] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapDelete( + "/test", + async ( + [FromForm] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromForm] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 07ba309..b5f6560 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [FromForm] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [FromForm] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromForm] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index b36d7af..eaf8c43 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromForm] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromForm] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromForm] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 7cf8bed..14270ce 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromForm] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromForm] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromForm] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index c34fa93..c4856d2 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.IFormFileTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromForm] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromForm] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromForm] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.cs b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.cs index 31fe90a..17a5e3f 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/ParameterAttributeTests.cs @@ -49,6 +49,8 @@ public async Task AsParametersTest(string method) var driver = GeneratorTestHelper.GetDriver( $$""" using System.Threading.Tasks; + using Microsoft.AspNetCore.Http; + using Microsoft.AspNetCore.Mvc; using Immediate.Apis.Shared; using Immediate.Handlers.Shared; @@ -58,10 +60,10 @@ namespace Dummy; [Map{{method}}("/test")] public static class GetUsersQuery { - [EndpointRegistrationOverride(EndpointRegistration.AsParameters)] public record Query; private static ValueTask Handle( + [AsParameters] Query _, CancellationToken token) { @@ -86,6 +88,8 @@ public async Task FromBodyTest(string method) var driver = GeneratorTestHelper.GetDriver( $$""" using System.Threading.Tasks; + using Microsoft.AspNetCore.Http; + using Microsoft.AspNetCore.Mvc; using Immediate.Apis.Shared; using Immediate.Handlers.Shared; @@ -95,10 +99,10 @@ namespace Dummy; [Map{{method}}("/test")] public static class GetUsersQuery { - [EndpointRegistrationOverride(EndpointRegistration.FromBody)] public record Query; private static ValueTask Handle( + [FromBody] Query _, CancellationToken token) { @@ -123,6 +127,8 @@ public async Task FromFormTest(string method) var driver = GeneratorTestHelper.GetDriver( $$""" using System.Threading.Tasks; + using Microsoft.AspNetCore.Http; + using Microsoft.AspNetCore.Mvc; using Immediate.Apis.Shared; using Immediate.Handlers.Shared; @@ -132,10 +138,10 @@ namespace Dummy; [Map{{method}}("/test")] public static class GetUsersQuery { - [EndpointRegistrationOverride(EndpointRegistration.FromForm)] public record Query; private static ValueTask Handle( + [FromForm] Query _, CancellationToken token) { @@ -160,6 +166,8 @@ public async Task FromHeaderTest(string method) var driver = GeneratorTestHelper.GetDriver( $$""" using System.Threading.Tasks; + using Microsoft.AspNetCore.Http; + using Microsoft.AspNetCore.Mvc; using Immediate.Apis.Shared; using Immediate.Handlers.Shared; @@ -169,10 +177,10 @@ namespace Dummy; [Map{{method}}("/test")] public static class GetUsersQuery { - [EndpointRegistrationOverride(EndpointRegistration.FromHeaders)] public record Query; private static ValueTask Handle( + [FromHeader] Query _, CancellationToken token) { @@ -197,6 +205,8 @@ public async Task FromQueryTest(string method) var driver = GeneratorTestHelper.GetDriver( $$""" using System.Threading.Tasks; + using Microsoft.AspNetCore.Http; + using Microsoft.AspNetCore.Mvc; using Immediate.Apis.Shared; using Immediate.Handlers.Shared; @@ -206,10 +216,10 @@ namespace Dummy; [Map{{method}}("/test")] public static class GetUsersQuery { - [EndpointRegistrationOverride(EndpointRegistration.FromQuery)] public record Query; private static ValueTask Handle( + [FromQuery] Query _, CancellationToken token) { @@ -234,6 +244,8 @@ public async Task FromRouteTest(string method) var driver = GeneratorTestHelper.GetDriver( $$""" using System.Threading.Tasks; + using Microsoft.AspNetCore.Http; + using Microsoft.AspNetCore.Mvc; using Immediate.Apis.Shared; using Immediate.Handlers.Shared; @@ -243,10 +255,10 @@ namespace Dummy; [Map{{method}}("/test")] public static class GetUsersQuery { - [EndpointRegistrationOverride(EndpointRegistration.FromRoute)] public record Query; private static ValueTask Handle( + [FromRoute] Query _, CancellationToken token) { diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 81ad6f5..4f40ce9 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + 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 + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 13fd28c..df3dd75 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [AsParameters] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index fcc77b8..11d10c6 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 90c41c7..19d457b 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index d3f5dbe..416b303 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleAsyncTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 81ad6f5..4f40ce9 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + 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 + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 13fd28c..df3dd75 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [AsParameters] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index fcc77b8..11d10c6 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 90c41c7..19d457b 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index d3f5dbe..416b303 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMethodHandleTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Delete#RouteBuilder.Dummy_GetUserQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Delete#RouteBuilder.Dummy_GetUserQuery.g.verified.cs index de8a719..9f773c6 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Delete#RouteBuilder.Dummy_GetUserQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Delete#RouteBuilder.Dummy_GetUserQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUserQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [AsParameters] global::Dummy.GetUserQuery.Query parameters, - [FromServices] global::Dummy.GetUserQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUserQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapDelete( + "/test", + async ( + [AsParameters] global::Dummy.GetUserQuery.Query parameters, + [FromServices] global::Dummy.GetUserQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUserQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 81ad6f5..4f40ce9 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + 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 + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Get#RouteBuilder.Dummy_GetUserQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Get#RouteBuilder.Dummy_GetUserQuery.g.verified.cs index 60d3dbc..91fef09 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Get#RouteBuilder.Dummy_GetUserQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Get#RouteBuilder.Dummy_GetUserQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUserQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [AsParameters] global::Dummy.GetUserQuery.Query parameters, - [FromServices] global::Dummy.GetUserQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUserQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [AsParameters] global::Dummy.GetUserQuery.Query parameters, + [FromServices] global::Dummy.GetUserQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUserQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 13fd28c..df3dd75 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [AsParameters] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Patch#RouteBuilder.Dummy_GetUserQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Patch#RouteBuilder.Dummy_GetUserQuery.g.verified.cs index 46cbd4c..76fb255 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Patch#RouteBuilder.Dummy_GetUserQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Patch#RouteBuilder.Dummy_GetUserQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUserQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromBody] global::Dummy.GetUserQuery.Query parameters, - [FromServices] global::Dummy.GetUserQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUserQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromBody] global::Dummy.GetUserQuery.Query parameters, + [FromServices] global::Dummy.GetUserQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUserQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index fcc77b8..11d10c6 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Post#RouteBuilder.Dummy_GetUserQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Post#RouteBuilder.Dummy_GetUserQuery.g.verified.cs index 6f27826..c2dfc4e 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Post#RouteBuilder.Dummy_GetUserQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Post#RouteBuilder.Dummy_GetUserQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUserQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromBody] global::Dummy.GetUserQuery.Query parameters, - [FromServices] global::Dummy.GetUserQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUserQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromBody] global::Dummy.GetUserQuery.Query parameters, + [FromServices] global::Dummy.GetUserQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUserQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 90c41c7..19d457b 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Put#RouteBuilder.Dummy_GetUserQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Put#RouteBuilder.Dummy_GetUserQuery.g.verified.cs index 06fc85c..55e93a7 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Put#RouteBuilder.Dummy_GetUserQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Put#RouteBuilder.Dummy_GetUserQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUserQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromBody] global::Dummy.GetUserQuery.Query parameters, - [FromServices] global::Dummy.GetUserQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUserQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromBody] global::Dummy.GetUserQuery.Query parameters, + [FromServices] global::Dummy.GetUserQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUserQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index d3f5dbe..416b303 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/SimpleApiTests.MapMultipleHandlersTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return ret; - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return ret; + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 6a44e43..f7a5fe0 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Delete#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapDelete( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return global::Dummy.GetUsersQuery.TransformResult(ret); - } - ); + 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 + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return global::Dummy.GetUsersQuery.TransformResult(ret); + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 372ec64..81d9f5e 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Get#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapGet( - "/test", - async ( - [AsParameters] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return global::Dummy.GetUsersQuery.TransformResult(ret); - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapGet( + "/test", + async ( + [AsParameters] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return global::Dummy.GetUsersQuery.TransformResult(ret); + } + ); + } } } + +namespace Dummy +{ + + /// registered using [AsParameters] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index b22ffce..3f68787 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Patch#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPatch( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return global::Dummy.GetUsersQuery.TransformResult(ret); - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPatch( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return global::Dummy.GetUsersQuery.TransformResult(ret); + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index f617ede..21c4487 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Post#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPost( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return global::Dummy.GetUsersQuery.TransformResult(ret); - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPost( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return global::Dummy.GetUsersQuery.TransformResult(ret); + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +} diff --git a/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs b/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs index 7f29448..993a0e2 100644 --- a/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs +++ b/tests/Immediate.Apis.Tests/GeneratorTests/TransformResultTests.TransformTest_method=Put#RouteBuilder.Dummy_GetUsersQuery.g.verified.cs @@ -4,24 +4,32 @@ #pragma warning disable CS1591 -namespace Microsoft.AspNetCore.Builder; - -public static partial class TestsRoutesBuilder +namespace Microsoft.AspNetCore.Builder { - private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + public static partial class TestsRoutesBuilder { - var endpoint = app - .MapPut( - "/test", - async ( - [FromBody] global::Dummy.GetUsersQuery.Query parameters, - [FromServices] global::Dummy.GetUsersQuery.Handler handler, - CancellationToken token - ) => - { - var ret = await handler.HandleAsync(parameters, token); - return global::Dummy.GetUsersQuery.TransformResult(ret); - } - ); + private static void MapDummy_GetUsersQueryEndpoint(IEndpointRouteBuilder app) + { + var endpoint = app + .MapPut( + "/test", + async ( + [FromBody] global::Dummy.GetUsersQuery.Query parameters, + [FromServices] global::Dummy.GetUsersQuery.Handler handler, + CancellationToken token + ) => + { + var ret = await handler.HandleAsync(parameters, token); + return global::Dummy.GetUsersQuery.TransformResult(ret); + } + ); + } } } + +namespace Dummy +{ + + /// registered using [FromBody] + partial class GetUsersQuery; +}