Skip to content

Commit

Permalink
refactor: remove configuration section check
Browse files Browse the repository at this point in the history
  • Loading branch information
cnblogs-dudu committed Jan 29, 2023
1 parent 5c3f83b commit ca887d7
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/Enyim.Caching/EnyimMemcachedServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ public static IServiceCollection AddEnyimMemcached(
throw new ArgumentNullException(nameof(configurationSection));
}

if (!configurationSection.Exists())
{
throw new ArgumentNullException($"{configurationSection.Key} in appsettings.json");
}

return services.AddEnyimMemcachedInternal(
s => s.Configure<MemcachedClientOptions>(configurationSection), asDistributedCache);
}
Expand All @@ -93,10 +88,6 @@ public static IServiceCollection AddEnyimMemcached(
}

var section = configuration.GetSection(sectionKey);
if (!section.Exists())
{
throw new ArgumentNullException($"{sectionKey} in appsettings.json");
}

return services.AddEnyimMemcachedInternal(
s => s.Configure<MemcachedClientOptions>(section), asDistributedCache);
Expand Down Expand Up @@ -157,12 +148,6 @@ public static IServiceCollection AddEnyimMemcached<T>(
throw new ArgumentNullException(nameof(configuration));
}

var section = configuration.GetSection(sectionKey);
if (!section.Exists())
{
throw new ArgumentNullException($"{sectionKey} in appsettings.json");
}

return services.AddEnyimMemcached<T>(
s => s.Configure<MemcachedClientOptions>(configuration.GetSection(sectionKey)));
}
Expand Down

0 comments on commit ca887d7

Please sign in to comment.