What are the usages of a generic method in C# without using type argument as input parameters or return value?
private void method1<T>()
I have just explored in ASP.NET Core code and saw they have used this kind of generic method in a lot of places.
For example in UseMiddleware in UseMiddlewareExtensions.
public static IApplicationBuilder UseMiddleware<TMiddleware>(this IApplicationBuilder app,
params object[] args)
{
return app.UseMiddleware(typeof(TMiddleware), args);
}
Is it a common pattern or I am wrong?