I have a method that takes an Action<> as a parameter. The parameter can be default, but how do I initialize the parameter with local parameter?
Code:
public static IServiceCollection AddAssetsSecure(this IServiceCollection services, Action<IdentityOptions> identity = default)
{
if (identity == default)
{
identity.Invoke(Statics.DefaultIdentityOptions); // throws null exception
}
return services
.AddAssetsIdentity(identity);
}