Exemple #1
0
        public IActionResult Cadastrar(EventoDTO evento)
        {
            try
            {
                Evento evt = new Evento();
                evt.Nome        = evento.Nome;
                evt.UrlImagem   = evento.UrlImagem;
                evt.CategoriaId = evento.CategoriaId;
                evt.Link        = evento.Link;
                evt.Descricao   = evento.Descricao;

                _eventoRepositorio.Adicionar(evt);

                return(Ok(new { data = evt }));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }