Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit 882bf6e

Browse files
committed
Aggiunto nuovo metodo statico
1 parent 2b4296f commit 882bf6e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/NET6CustomLibrary/Extensions/DependencyInjection.cs

+16
Original file line numberDiff line numberDiff line change
@@ -338,4 +338,20 @@ public static IServiceCollection AddMailKitEmailSenderService(this IServiceColle
338338
return services;
339339
}
340340
#endregion
341+
342+
#region "REDIS CACHE"
343+
public static IServiceCollection AddRedisCacheService(this IServiceCollection services, IConfiguration configuration)
344+
{
345+
services.AddStackExchangeRedisCache(options =>
346+
{
347+
options.Configuration = configuration.GetSection("ConnectionStrings").GetValue<string>("Redis");
348+
options.InstanceName = configuration.GetSection("Redis").GetValue<string>("InstanceName");
349+
});
350+
351+
services.
352+
Configure<RedisOptions>(configuration.GetSection("Redis"));
353+
354+
return services;
355+
}
356+
#endregion
341357
}

0 commit comments

Comments
 (0)