ardalis / ApiEndpoints

A project for supporting API Endpoints in ASP.NET Core web applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question - Would it make sense to Unify BaseAsyncEndpoint and BaseEndpoint?

kazeshini178 opened this issue · comments

I was curious if having a singular root (Base)Endpoint class with the determining of whether the Endpoint was Async or Sync left till the end would make sense.

Not sure if something like the below would make any difference with developer experience or usage.

public static class Endpoint
{
 ... // As is now with the current request classes
    public abstract WithAsyncResponse<TResp> : BaseEndpoint
    {
         // Async method
    }

    public abstract WithResponse<TResp> : BaseEndpoint
    {
         // Sync method
    }
// Without options
...
}

It basically makes no sense due to the need to add ASYNC and it can also be misleading

I prefer the naming as-is, so unless there's a compelling argument to be made I think I'm going to keep the current approach. Thanks!