CarterCommunity / Carter

Carter is framework that is a thin layer of extension methods and functionality over ASP.NET Core allowing code to be more explicit and most importantly more enjoyable.
MIT License
2.05k stars 172 forks source link

Removed support to apply endpoint conventions globally #329

Closed mikeolasz closed 7 months ago

mikeolasz commented 7 months ago

With this change the return type MapCarter was changed and it's no longer IEndpointConventionBuilder. It would have been really nice to put RequireAuthorization on all endpoints.

The discussion here introduced a nice solution and it's partly removed now. Is there any chance it's gonna be reintroduced or updated?

Currently I don't see any way to apply conventions for multiple endpoints only one-by-one. Could you suggest a solution for this?

jchannon commented 7 months ago

You can do it at the module level. (although its commented out here) https://github.com/CarterCommunity/Carter/blob/main/samples/CarterSample/Features/Directors/DirectorsModule.cs#L10

mikeolasz commented 7 months ago

That's unfortunate. It would've been really nice if you could use it similarly to ASP.NET Core's MapControllers etc. Thanks!