Beispiel #1
0
        public IActionResult Publicar(int id)
        {
            var post = _dao.BuscarPorId(id);

            if (post != null)
            {
                post.Publicado      = true;
                post.DataPublicacao = System.DateTime.Now;
                _dao.Alterar(post);
                return(RedirectToAction("Index"));
            }
            return(NotFound());
        }
 public IActionResult Alterar(Post post)
 {
     _dao.Alterar(post);
     return(Ok(post));
 }