public CalculatorAppContext(ODSContext oDSContext, ApiMemoryCache memoryCache, IHttpContextAccessor contextAccessor, IOptions <AppConfiguration> appConfiguration, IStudentDataRepository dataRepository, IGradingScaleRepository gradingScaleRepository) { MemoryCache = memoryCache.Cache; ODSContext = oDSContext; UserContext = contextAccessor; AppConfiguration = appConfiguration; StudentDataRepository = dataRepository; GradingScaleRepository = gradingScaleRepository; }
public AbstractStudentMetricCalculator(CalculatorAppContext appContext) { if (appContext != null) { _context = appContext.ODSContext; _memoryCache = appContext.MemoryCache; _appConfiguration = appContext.AppConfiguration; StudentDataRepository = appContext.StudentDataRepository; GradingScaleRepository = appContext.GradingScaleRepository; } _cacheEntryOptions = new MemoryCacheEntryOptions() .SetSize(100)//Size amount .SetPriority(CacheItemPriority.High) .SetSlidingExpiration(TimeSpan.FromMinutes(15)) .SetAbsoluteExpiration(TimeSpan.FromMinutes(60)); }