public override async Task <BaseReply> Incluir(ImpedimentoTarefaModel request, ServerCallContext context) { return(await Task.FromResult(new BaseReply { Id = _impedimentoTarefaAppService.Incluir(_mapper.Map <ImpedimentoTarefaViewModel>(request)).ToString() })); }
public ActionResult <ImpedimentoTarefaViewModel> Post([FromBody] ImpedimentoTarefaViewModel obj) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { obj.Id = _impedimentoTarefaAppService.Incluir(obj); } catch (Exception) { if (ObjExists(obj.Id)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetImpedimentoTarefa", new { id = obj.Id }, obj)); }
public IActionResult OnPost(Guid idTarefa) { if (!ModelState.IsValid) { Tarefa = _tarefaAppService.Consultar(idTarefa); SelectImpedimentos = new SelectList(_impedimentoAppService.Listar(), "Id", "Nome"); return(Page()); } _impedimentoTarefaAppService.Incluir(ImpedimentoTarefa); return(RedirectToPage("Listar", new { idTarefa })); }