public IActionResult Agregar([FromBody] Noticia NoticiaAgregar)
 {
     if (_ns.Agregar(NoticiaAgregar))
     {
         return(Ok());
     }
     else
     {
         return(BadRequest());
     }
 }
Exemplo n.º 2
0
        public IActionResult Agregar([FromBody] Noticia _noticia)
        {
            var resultado = _noticiaService.Agregar(_noticia);

            if (resultado)
            {
                return(Ok(_noticia));
            }
            else
            {
                return(BadRequest());
            }
        }