Currently in ASP.NET Core, writing a generic IModelBinderProvider is difficult, because there is no way to generically constrain that T has GetAllTypes or GetType static methods. These two helper methods allow the caller to understand all the possible supported types and get a type from a passed enum respectively.
Proposal: Declare and a known interface with GetAllTypes and GetTypes then have each polymorpyhic class inherit that interface
Currently in ASP.NET Core, writing a generic IModelBinderProvider is difficult, because there is no way to generically constrain that T has
GetAllTypes
orGetType
static methods. These two helper methods allow the caller to understand all the possible supported types and get a type from a passed enum respectively.Proposal: Declare and a known interface with
GetAllTypes
andGetType
s then have each polymorpyhic class inherit that interface