LexWells.Infrastructure/LexWells.Infrastructure.Common/DependencyInjection.cs

24 lines
716 B
C#

using LexWells.Infrastructure.Common.Interfaces;
using LexWells.Infrastructure.Common.Services;
using Microsoft.Extensions.DependencyInjection;
namespace LexWells.Infrastructure.Common;
public static class DependencyInjection
{
public static IServiceCollection AddLexWellsInfrastructure(this IServiceCollection services, string redisConnectionString)
{
services.AddStackExchangeRedisCache(options =>
{
options.Configuration = redisConnectionString;
});
services.AddSingleton<ICacheService, RedisCacheService>();
services.AddHttpClient();
services.AddSingleton<IRobotsService, RobotsService>();
return services;
}
}