Skip to content

Commit

Permalink
Add check for null parameters to extension methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewTriesToCode committed Dec 22, 2023
1 parent 6d4527c commit 57021ee
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public static OptionsBuilder<TOptions> ConfigurePerTenant<TOptions, TTenantInfo>
where TOptions : class
where TTenantInfo : class, ITenantInfo, new()
{
if (configureOptions == null) throw new ArgumentNullException(nameof(configureOptions));

FinbuckleServiceCollectionExtensions.ConfigurePerTenantReqs<TOptions>(optionsBuilder.Services);

optionsBuilder.Services.AddTransient<IConfigureOptions<TOptions>>(sp =>
Expand All @@ -39,6 +41,8 @@ public static OptionsBuilder<TOptions> ConfigurePerTenant<TOptions, TDep, TTenan
where TDep : class
where TTenantInfo : class, ITenantInfo, new()
{
if (configureOptions == null) throw new ArgumentNullException(nameof(configureOptions));

FinbuckleServiceCollectionExtensions.ConfigurePerTenantReqs<TOptions>(optionsBuilder.Services);

optionsBuilder.Services.AddTransient<IConfigureOptions<TOptions>>(sp =>
Expand All @@ -62,6 +66,8 @@ public static OptionsBuilder<TOptions> ConfigurePerTenant<TOptions, TDep1, TDep2
where TDep2 : class
where TTenantInfo : class, ITenantInfo, new()
{
if (configureOptions == null) throw new ArgumentNullException(nameof(configureOptions));

FinbuckleServiceCollectionExtensions.ConfigurePerTenantReqs<TOptions>(optionsBuilder.Services);

optionsBuilder.Services.AddTransient<IConfigureOptions<TOptions>>(sp =>
Expand All @@ -88,6 +94,8 @@ public static OptionsBuilder<TOptions> ConfigurePerTenant<TOptions, TDep1, TDep2
where TDep3 : class
where TTenantInfo : class, ITenantInfo, new()
{
if (configureOptions == null) throw new ArgumentNullException(nameof(configureOptions));

FinbuckleServiceCollectionExtensions.ConfigurePerTenantReqs<TOptions>(optionsBuilder.Services);

optionsBuilder.Services.AddTransient<IConfigureOptions<TOptions>>(sp =>
Expand Down Expand Up @@ -116,6 +124,8 @@ public static OptionsBuilder<TOptions> ConfigurePerTenant<TOptions, TDep1, TDep2
where TDep4 : class
where TTenantInfo : class, ITenantInfo, new()
{
if (configureOptions == null) throw new ArgumentNullException(nameof(configureOptions));

FinbuckleServiceCollectionExtensions.ConfigurePerTenantReqs<TOptions>(optionsBuilder.Services);

optionsBuilder.Services.AddTransient<IConfigureOptions<TOptions>>(sp =>
Expand Down Expand Up @@ -146,6 +156,8 @@ public static OptionsBuilder<TOptions> ConfigurePerTenant<TOptions, TDep1, TDep2
where TDep5 : class
where TTenantInfo : class, ITenantInfo, new()
{
if (configureOptions == null) throw new ArgumentNullException(nameof(configureOptions));

FinbuckleServiceCollectionExtensions.ConfigurePerTenantReqs<TOptions>(optionsBuilder.Services);

optionsBuilder.Services.AddTransient<IConfigureOptions<TOptions>>(sp =>
Expand Down Expand Up @@ -173,6 +185,8 @@ public static OptionsBuilder<TOptions> PostConfigurePerTenant<TOptions, TTenantI
where TOptions : class
where TTenantInfo : class, ITenantInfo, new()
{
if (configureOptions == null) throw new ArgumentNullException(nameof(configureOptions));

FinbuckleServiceCollectionExtensions.ConfigurePerTenantReqs<TOptions>(optionsBuilder.Services);

optionsBuilder.Services.AddTransient<IPostConfigureOptions<TOptions>>(sp =>
Expand All @@ -194,6 +208,8 @@ public static OptionsBuilder<TOptions> PostConfigurePerTenant<TOptions, TDep, TT
where TDep : class
where TTenantInfo : class, ITenantInfo, new()
{
if (configureOptions == null) throw new ArgumentNullException(nameof(configureOptions));

FinbuckleServiceCollectionExtensions.ConfigurePerTenantReqs<TOptions>(optionsBuilder.Services);

optionsBuilder.Services.AddTransient<IPostConfigureOptions<TOptions>>(sp =>
Expand All @@ -217,6 +233,8 @@ public static OptionsBuilder<TOptions> PostConfigurePerTenant<TOptions, TDep1, T
where TDep2 : class
where TTenantInfo : class, ITenantInfo, new()
{
if (configureOptions == null) throw new ArgumentNullException(nameof(configureOptions));

FinbuckleServiceCollectionExtensions.ConfigurePerTenantReqs<TOptions>(optionsBuilder.Services);

optionsBuilder.Services.AddTransient<IPostConfigureOptions<TOptions>>(sp =>
Expand All @@ -243,6 +261,8 @@ public static OptionsBuilder<TOptions> PostConfigurePerTenant<TOptions, TDep1, T
where TDep3 : class
where TTenantInfo : class, ITenantInfo, new()
{
if (configureOptions == null) throw new ArgumentNullException(nameof(configureOptions));

FinbuckleServiceCollectionExtensions.ConfigurePerTenantReqs<TOptions>(optionsBuilder.Services);

optionsBuilder.Services.AddTransient<IPostConfigureOptions<TOptions>>(sp =>
Expand Down Expand Up @@ -271,6 +291,8 @@ public static OptionsBuilder<TOptions> PostConfigurePerTenant<TOptions, TDep1, T
where TDep4 : class
where TTenantInfo : class, ITenantInfo, new()
{
if (configureOptions == null) throw new ArgumentNullException(nameof(configureOptions));

FinbuckleServiceCollectionExtensions.ConfigurePerTenantReqs<TOptions>(optionsBuilder.Services);

optionsBuilder.Services.AddTransient<IPostConfigureOptions<TOptions>>(sp =>
Expand Down Expand Up @@ -301,6 +323,8 @@ public static OptionsBuilder<TOptions> PostConfigurePerTenant<TOptions, TDep1, T
where TDep5 : class
where TTenantInfo : class, ITenantInfo, new()
{
if (configureOptions == null) throw new ArgumentNullException(nameof(configureOptions));

FinbuckleServiceCollectionExtensions.ConfigurePerTenantReqs<TOptions>(optionsBuilder.Services);

optionsBuilder.Services.AddTransient<IPostConfigureOptions<TOptions>>(sp =>
Expand Down

0 comments on commit 57021ee

Please sign in to comment.