Closed ergonzalez-boh closed 1 month ago
Hello @ergonzalez-boh
RouteGroupBuilder root = app.MapGroup("/api");
root.MapCarter();
root.AddEndpointFilterFactory(ValidationFilter.ValidationFilterFactory);
Can't you solve it with that?
Closing - as of .NET6 you should be using ICarterModule
not CarterModule
and you can use the EndpointFilterFactory stuff directly
Currently, Carter provides the ability to register endpoint filters through the CarterModule Before and After delegates. However, there is no built-in mechanism to incorporate an EndpointFilterFactory that would allow dynamic determination of whether an endpoint filter should be added to a specific endpoint during startup.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/min-api-filters?view=aspnetcore-7.0#register-a-filter-using-an-endpoint-filter-factory