コード例 #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))
     }));
 }
コード例 #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))
     }));
 }
コード例 #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());
        }