I am trying to create a generic method that use IOptions<T> as parameter but the code seems to be invalid.
Visual studio displays the following message:
TConfig must be a non-abstract type with a non-parameterless constructor in order to use it as a parameter 'TOption' in the generic type or method
'IOptions<TOptions>'
Any suggestion on how to fix this would be appreciated. Thanks!!
public static IServiceCollection AddConfigurations<TConfig>(
this IServiceCollection services, IConfiguration configuration,
IOptions<TConfig> options)
where TConfig : class
{
}