Skip to content

Commit ca887d7

Browse files
committed
refactor: remove configuration section check
1 parent 5c3f83b commit ca887d7

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

src/Enyim.Caching/EnyimMemcachedServiceCollectionExtensions.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ public static IServiceCollection AddEnyimMemcached(
6767
throw new ArgumentNullException(nameof(configurationSection));
6868
}
6969

70-
if (!configurationSection.Exists())
71-
{
72-
throw new ArgumentNullException($"{configurationSection.Key} in appsettings.json");
73-
}
74-
7570
return services.AddEnyimMemcachedInternal(
7671
s => s.Configure<MemcachedClientOptions>(configurationSection), asDistributedCache);
7772
}
@@ -93,10 +88,6 @@ public static IServiceCollection AddEnyimMemcached(
9388
}
9489

9590
var section = configuration.GetSection(sectionKey);
96-
if (!section.Exists())
97-
{
98-
throw new ArgumentNullException($"{sectionKey} in appsettings.json");
99-
}
10091

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

160-
var section = configuration.GetSection(sectionKey);
161-
if (!section.Exists())
162-
{
163-
throw new ArgumentNullException($"{sectionKey} in appsettings.json");
164-
}
165-
166151
return services.AddEnyimMemcached<T>(
167152
s => s.Configure<MemcachedClientOptions>(configuration.GetSection(sectionKey)));
168153
}

0 commit comments

Comments
 (0)