public ActionResult Edit(FormCollection collection) { try { var s = _settingService.Get(); if (s != null) { s.SettingsCacheTimeInMinutes = int.Parse(collection["CacheTimeInMinutes"]); s.GridPageSize = int.Parse(collection["GridPageSize"]); s.ShowContentEllipsis = bool.Parse(collection["ShowContentEllipsis"]); s.ContentExtractLength = int.Parse(collection["ContentExtractLength"]); s.AllowRejectedContentReActivation = bool.Parse(collection["AllowRejectedContentReactivation"]); s.AllowExpiredContentReActivation = bool.Parse(collection["AllowExpiredContentReactivation"]); s.ModifiedBy = "XXXX"; _settingService.Save(s); } // Remove the existing cached settings item; it will be re-added back automatically by the BaseController var cacheService = new CacheService(); return RedirectToAction("Index"); } catch { return View(); } }
public SettingService(ISettingRepository repository, CacheService cacheService) { _repository = repository; _cacheService = cacheService; }