public async Task<ActionResult> AppearanceUpdate(AppearanceModel model) { var settingExisting = _settingService.Query(x => x.ID == model.ID).Select().FirstOrDefault(); settingExisting.ObjectState = Repository.Pattern.Infrastructure.ObjectState.Modified; _settingService.Update(settingExisting); await _unitOfWorkAsync.SaveChangesAsync(); _dataCacheService.UpdateCache(CacheKeys.Settings, settingExisting); SavePicture(model.Favicon, "favicon", new Size(32, 32)); SavePicture(model.CoverPhoto, "cover", new Size(1048, 0)); SavePicture(model.Logo, "logo", new Size(200, 30), "png"); return RedirectToAction("Appearance"); }
public ActionResult Appearance() { var setting = _settingService.Queryable().FirstOrDefault(); var model = new AppearanceModel() { ID = setting.ID, CoverPhotoUrl = ImageHelper.GetCommunityImagePath("cover"), FaviconUrl = ImageHelper.GetCommunityImagePath("favicon"), LogoUrl = ImageHelper.GetCommunityImagePath("logo", "png") }; return View(model); }