Ejemplo n.º 1
0
 public override async Task <BaseReply> Alterar(ProjetoModel request, ServerCallContext context)
 {
     return(await Task.FromResult(new BaseReply
     {
         Sucesso = _projetoAppService.Alterar(_mapper.Map <ProjetoViewModel>(request))
     }));
 }
Ejemplo n.º 2
0
 public override async Task <BaseReply> Alterar(TipoTarefaModel request, ServerCallContext context)
 {
     return(await Task.FromResult(new BaseReply
     {
         Sucesso = _tipoTarefaAppService.Alterar(_mapper.Map <TipoTarefaViewModel>(request))
     }));
 }
Ejemplo n.º 3
0
        public IActionResult Put(Guid id, [FromBody] ProjetoViewModel obj)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != obj.Id)
            {
                return(BadRequest());
            }

            try
            {
                _projetoAppService.Alterar(obj);
            }
            catch (Exception)
            {
                if (!ObjExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }