Fix cache injection settings
This commit is contained in:
		| @@ -2,7 +2,6 @@ using Core.Blueprint.DAL.API.Extensions; | ||||
| using Core.Blueprint.DAL.Mongo.Configuration; | ||||
| using Core.Blueprint.KeyVault.Configuration; | ||||
| using Core.Blueprint.Logging.Configuration; | ||||
| using Core.Blueprint.Redis; | ||||
| using Core.Blueprint.Redis.Configuration; | ||||
| using Core.Blueprint.SQLServer.Configuration; | ||||
| using Core.Blueprint.Storage.Configuration; | ||||
| @@ -44,7 +43,6 @@ builder.Services.AddRedis(builder.Configuration); | ||||
| builder.Services.AddMongoLayer(builder.Configuration); | ||||
| builder.Services.AddSQLServer(builder.Configuration); | ||||
| builder.Services.AddDALLayerServices(builder.Configuration); | ||||
| builder.Services.Configure<CacheSettings>(builder.Configuration.GetSection("CacheSettings")); | ||||
|  | ||||
| builder.Host.ConfigureServices((context, services) => | ||||
| { | ||||
|   | ||||
| @@ -5,22 +5,21 @@ using Core.Blueprint.Mongo; | ||||
| using Core.Blueprint.Redis; | ||||
| using Core.Blueprint.Redis.Helpers; | ||||
| using Mapster; | ||||
| using Microsoft.Extensions.Options; | ||||
|  | ||||
| namespace Core.Blueprint.DAL.Mongo.Service | ||||
| { | ||||
|     public class MongoSampleService : IMongoSampleService | ||||
|     { | ||||
|         private readonly CollectionRepository<SampleCollection> repository; | ||||
|         private readonly CacheSettings cacheSettings; | ||||
|         private readonly ICacheSettings cacheSettings; | ||||
|         private readonly IRedisCacheProvider cacheProvider; | ||||
|  | ||||
|         public MongoSampleService(CollectionRepository<SampleCollection> repository, | ||||
|         IRedisCacheProvider cacheProvider, IOptions<CacheSettings> cacheSettings) | ||||
|         IRedisCacheProvider cacheProvider, ICacheSettings cacheSettings) | ||||
|         { | ||||
|             this.repository = repository; | ||||
|             this.repository.CollectionInitialization(); | ||||
|             this.cacheSettings = cacheSettings.Value; | ||||
|             this.cacheSettings = cacheSettings; | ||||
|             this.cacheProvider = cacheProvider; | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -6,18 +6,17 @@ using Core.Blueprint.DAL.SQLServer.Entities.Request; | ||||
| using Core.Blueprint.Redis; | ||||
| using Core.Blueprint.Redis.Helpers; | ||||
| using Mapster; | ||||
| using Microsoft.Extensions.Options; | ||||
|  | ||||
| public class SqlSampleService : ISqlSampleService | ||||
| { | ||||
|     private readonly IEntityRepository<Sample, SqlServerContext> _sqlSampleRepository; | ||||
|     private readonly CacheSettings cacheSettings; | ||||
|     private readonly ICacheSettings cacheSettings; | ||||
|     private readonly IRedisCacheProvider cacheProvider; | ||||
|  | ||||
|     public SqlSampleService(IEntityRepository<Sample, SqlServerContext> sqlSampleRepository, IRedisCacheProvider cacheProvider, IOptions<CacheSettings> cacheSettings) | ||||
|     public SqlSampleService(IEntityRepository<Sample, SqlServerContext> sqlSampleRepository, IRedisCacheProvider cacheProvider, ICacheSettings cacheSettings) | ||||
|     { | ||||
|         _sqlSampleRepository = sqlSampleRepository; | ||||
|         this.cacheSettings = cacheSettings.Value; | ||||
|         this.cacheSettings = cacheSettings; | ||||
|         this.cacheProvider = cacheProvider; | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user