Beispiel #1
0
        public ActionResult Edit(Solectwo modelReturned)
        {
            Solectwo dataBase = repository.Solectwos.FirstOrDefault();

            dataBase.Tresc = HtmlUtility.RemoveInvalidHtmlTags(modelReturned.Tresc);
            repository.SaveSolectwo(dataBase);
            return(RedirectToAction(nameof(Index)));
        }
Beispiel #2
0
        public ActionResult Edit()
        {
            Solectwo dataBase = repository.Solectwos.FirstOrDefault();

            if (dataBase == null)
            {
                dataBase = new Solectwo
                {
                    Tresc = "Wpisz tutaj treść."
                };
                repository.SaveSolectwo(dataBase);
            }
            return(View(dataBase));
        }