예제 #1
0
 public async Task <ActionResult <Resultado> > Post(CadastroManifestacaoViewModel manifestacao)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest());
     }
     return(Ok(await _service.Create(manifestacao)));
 }
예제 #2
0
        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());
        }