
Folks, a couple of weeks ago I was watching a video where someone used a NuGet package in a minimal Web API project to change the plumbing slightly so that it was easier to code the endpoint methods. By default, the endpoint methods must be strictly coded and it's tricky to break them apart or make partial methods. The package I saw added some magic to make coding the endpoints easier, but I can't remember exactly how. I just remember thinking "that looks handy" and now I can't find it. Any idea what it might have been? *Greg Keogh*

Folks, a couple of weeks ago I was watching a video where someone used a NuGet package in a minimal Web API project to change the plumbing slightly so that it was easier to code the endpoint methods. By default, the endpoint methods must be strictly coded and it's tricky to break them apart or make partial methods. The package I saw added some magic to make coding the endpoints easier, but I can't remember exactly how. I just remember thinking "that looks handy" and now I can't find it. Any idea what it might have been? Greg Keogh I think the package you are looking for is Carter https://www.nuget.org/packages/Carter https://github.com/CarterCommunity/Carter This message contains privileged and confidential information intended only for the use of the addressee named above. If you are not the intended recipient of this message you are hereby notified that you must not disseminate, copy or take any action or place any reliance on it. If you have received this message in error please notify the sender immediately via return email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of the company.

I think the package you are looking for is Carter
Yes thanks, that looks familiar. It doesn't look quite as *clever* as I recall, but I'll look into it anyway. I tried something vaguely similar myself last year, but it's time to revisit the issue and see how someone else tackled the matter. *Greg*

I think the package you are looking for is Carter
Folks, some quick feedback. Carter wasn't quite as attractive as I guessed. It adds too much of what I call "magic plumbing" and lots of fluent methods for validation and authorisation that weren't of much use for me. I didn't want to get married to another framework without a good reason, so I skipped it and moved all my endpoint methods into a partial class: static partial class Program { public static void MapEndpoints(IEndpointRouteBuilder app, WebApplicationBuilder builder) { app.MapPost(...) { etc } // etc } } I call MapEndpoints(...) during program startup and it separates all that code into a separate file, and for a good reason ... I use a T4 template to generate about 1000 lines of repetitive app.mapxxx(...) calls into that partial file. *Greg K*
participants (2)
-
Cameron Booth
-
Greg Keogh