namespace Microsoft.AspNetCore.Http;
public interface IEndpointFilter
{
ValueTask<object?> InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next);
}
I am wondering why the above interface is not made as follows?
namespace Microsoft.AspNetCore.Http;
public interface<T> IEndpointFilter
{
ValueTask<T?> InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next);
}
while using generic type, you force the developer to use a type to implement the methods which may be confusing or not necessary here