public async Task <ActionResult <Resultado> > Post(CadastroManifestacaoViewModel manifestacao) { if (!ModelState.IsValid) { return(BadRequest()); } return(Ok(await _service.Create(manifestacao))); }
public async Task <Resultado> Create(CadastroManifestacaoViewModel manifestacao) { var manifestation = Mapper.Map <Manifestacao>(manifestacao); manifestation.SetCreator(_user.GetId()); await _service.Create(manifestation); return(Notificador.HasNotification() ? Resultado.Failed(Notificador.GetNotificationsMessages()) : Resultado.Successfull()); }