public async Task <IActionResult> Index() { var model = new SettingsIndexModel { AllInclusivePrice = await memoryCache.GetAllInclusivePrice(settingService), BreakfastPrice = await memoryCache.GetBreakfastPrice(settingService), }; return(View(model)); }
public async Task <IActionResult> Index(SettingsIndexModel model) { await settingService.UpdateAsync("AllInclusivePrice", model.AllInclusivePrice.ToString(), typeof(double).ToString()); await settingService.UpdateAsync("BreakfastPrice", model.BreakfastPrice.ToString(), typeof(double).ToString()); memoryCache.ClearPriceCache(); TempData["Success"] = true; return(RedirectToAction(nameof(Index))); }