Exemplo n.º 1
0
        public ActionResult Create(int id, KomentarzModel model)
        {
            model.IdPosta = id;
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            try
            {
                _komenatrze.DodajKomentarz(model.IdPosta, model.Autor, model.Tresc, model.Status);
                return(RedirectToAction("Details", "Post", new { id = id }));
            }
            catch
            {
                return(View());
            }
        }