public IndexModel(ILogger <IndexModel> logger, IMemoryCache memoryCache, pwsstoreContext context, IServiceScopeFactory serviceFactory) { _logger = logger; _memoryCache = memoryCache; _context = context; _serviceScopeFactory = serviceFactory; }
public pwsController(IMemoryCache memoryCache, pwsstoreContext context, IServiceScopeFactory serviceFactory, Microsoft.Extensions.Configuration.IConfiguration configuration) { _configuration = configuration; _memoryCache = memoryCache; _context = context; _serviceFactory = serviceFactory; }
protected async Task storeCachedWeatherData(int IdPws, IEnumerable <Weather> lstWeather) { var insWeather = lstWeather.GroupBy(w => w.Dateutc.DayOfYear).GetAverage(windgustMax: true); using (var scope = _serviceFactory.CreateScope()) { pwsstoreContext context = scope.ServiceProvider.GetRequiredService <pwsstoreContext>(); await context.Weather.AddRangeAsync(insWeather); await context.SaveChangesAsync(); } }
public weatherController(IMemoryCache memoryCache, pwsstoreContext context, IServiceScopeFactory serviceFactory) { _memoryCache = memoryCache; _context = context; _serviceFactory = serviceFactory; }
public CacheWeatherLogic(IMemoryCache memoryCache, pwsstoreContext context, IServiceScopeFactory serviceFactory) { _memCache = memoryCache; _context = context; _serviceFactory = serviceFactory; }