public static RouteHandlerBuilder MapCommand <TCommand, TAggregate>( this IEndpointRouteBuilder builder, EnrichCommandFromHttpContext <TCommand>?enrichCommand = null ) where TAggregate : Aggregate where TCommand : class { var attr = typeof(TCommand).GetAttribute <HttpCommandAttribute>(); var route = GetRoute <TCommand>(attr?.Route); return(builder.MapCommand <TCommand, TAggregate>(route, enrichCommand)); }
public static RouteHandlerBuilder MapCommand <TCommand, TAggregate>( this IEndpointRouteBuilder builder, string route, EnrichCommandFromHttpContext <TCommand>?enrichCommand = null ) where TAggregate : Aggregate where TCommand : class => Map <TAggregate, TCommand>(builder, route, enrichCommand);