public override async Task <BaseReply> Incluir(TipoTarefaModel request, ServerCallContext context) { return(await Task.FromResult(new BaseReply { Id = _tipoTarefaAppService.Incluir(_mapper.Map <TipoTarefaViewModel>(request)).ToString() })); }
public ActionResult <ProjetoViewModel> Post([FromBody] ProjetoViewModel obj) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { obj.Id = _projetoAppService.Incluir(obj); } catch (Exception) { if (ObjExists(obj.Id)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetProjeto", new { id = obj.Id }, obj)); }
public override async Task <BaseReply> Incluir(ProjetoModel request, ServerCallContext context) { return(await Task.FromResult(new BaseReply { Id = _projetoAppService.Incluir(_mapper.Map <ProjetoViewModel>(request)).ToString() })); }
public ActionResult <SistemaViewModel> Post([FromBody] SistemaViewModel obj) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { _sistemaAppService.Incluir(obj); } catch (Exception) { if (ObjExists(obj.Id)) { return(Conflict()); } else { throw; } } return(CreatedAtAction(nameof(Get), new { id = obj.Id }, obj)); }