public IActionResult Posts(SettingsPosts model) { model.Profile = GetProfile(); if (ModelState.IsValid) { this.db.CustomFields.SetCustomField(CustomType.Application, 0, Constants.ItemsPerPage, model.ItemsPerPage.ToString()); BlogSettings.ItemsPerPage = model.ItemsPerPage; this.db.CustomFields.SetCustomField(CustomType.Application, 0, Constants.PostImage, model.PostImage); BlogSettings.PostCover = model.PostImage; this.db.CustomFields.SetCustomField(CustomType.Application, 0, Constants.PostCode, model.PostFooter); this.db.Complete(); ViewBag.Message = "Updated"; } return(View(this.theme + "Posts.cshtml", model)); }
public IActionResult Posts() { var profile = GetProfile(); var model = new SettingsPosts { Profile = profile, PostImage = BlogSettings.Cover, PostFooter = _db.CustomFields.GetValue(CustomType.Application, 0, Constants.PostCode), ItemsPerPage = BlogSettings.ItemsPerPage }; return(View(_theme + "Posts.cshtml", model)); }