public ActionResult Edit(Solectwo modelReturned) { Solectwo dataBase = repository.Solectwos.FirstOrDefault(); dataBase.Tresc = HtmlUtility.RemoveInvalidHtmlTags(modelReturned.Tresc); repository.SaveSolectwo(dataBase); return(RedirectToAction(nameof(Index))); }
public ActionResult Edit() { Solectwo dataBase = repository.Solectwos.FirstOrDefault(); if (dataBase == null) { dataBase = new Solectwo { Tresc = "Wpisz tutaj treść." }; repository.SaveSolectwo(dataBase); } return(View(dataBase)); }