| | | 1 | | using OzonDomains.Models; |
| | | 2 | | using Services.CacheServices.Cache.CartCache; |
| | | 3 | | using Services.CacheServices.Cache.OrderSummaryCache; |
| | | 4 | | using Services.CacheServices.Cache.OzonOrdersCache; |
| | | 5 | | using Services.CacheServices.Cache.UniqueValuesCache; |
| | | 6 | | using Services.CacheServices.Cache.UserCacheService; |
| | | 7 | | using Services.CacheServices.Cache; |
| | | 8 | | using Services.CacheServices.Cache.EtProducerCache; |
| | | 9 | | |
| | | 10 | | namespace OzonOrdersWeb.Extensions; |
| | | 11 | | |
| | | 12 | | public static class CacheExtensions |
| | | 13 | | { |
| | | 14 | | public static void AddCacheServices(this IServiceCollection services) |
| | | 15 | | { |
| | 0 | 16 | | services.AddMemoryCache(); |
| | 0 | 17 | | services.AddDistributedMemoryCache(); |
| | 0 | 18 | | services.AddSession(); |
| | | 19 | | |
| | 0 | 20 | | services.AddSingleton<AppCache>(); |
| | 0 | 21 | | services.AddScoped<OrderCache>(); |
| | 0 | 22 | | services.AddScoped<EtProducerCache>(); |
| | 0 | 23 | | services.AddScoped<ProductCache>(); |
| | 0 | 24 | | services.AddScoped<TransactionCache>(); |
| | | 25 | | |
| | 0 | 26 | | services.AddScoped<CacheUpdater<Product>>(); |
| | 0 | 27 | | services.AddScoped<CacheUpdater<Order>>(); |
| | 0 | 28 | | services.AddScoped<CacheUpdater<Transaction>>(); |
| | | 29 | | |
| | 0 | 30 | | services.AddScoped<IUniqueValuesCache, UniqueValuesCache>(); |
| | 0 | 31 | | services.AddScoped<IUserCacheService, UserCacheService>(); |
| | | 32 | | |
| | 0 | 33 | | services.AddScoped<CartCache>(); |
| | | 34 | | |
| | 0 | 35 | | services.AddSingleton<IOrderSummaryCache, OrderSummaryCache>(); |
| | 0 | 36 | | } |
| | | 37 | | } |