public override async Task <BaseReply> Remover(BaseRequest request, ServerCallContext context) { return(await Task.FromResult(new BaseReply { Sucesso = _tarefaAppService.Remover(new Guid(request.Id)) })); }
public IActionResult Delete(Guid id) { TarefaViewModel obj = _tarefaAppService.Consultar(id); if (obj == null) { return(NotFound()); } _tarefaAppService.Remover(id); return(NoContent()); }
public async Task <IActionResult> Delete(Guid?id) { if (id == null) { return(NotFound()); } var tarefa = await _tarefaAppService.BuscarPorId(id.Value); if (tarefa == null) { return(NotFound()); } var sucesso = _tarefaAppService.Remover(tarefa); return(Response(sucesso)); }
public async Task <IActionResult> DeleteConfirmed(Guid?id) { if (id == null) { return(NotFound()); } var tarefa = await _tarefaAppService.BuscarPorId(id.Value); if (tarefa == null) { return(NotFound()); } var sucesso = _tarefaAppService.Remover(tarefa); TempData["RetornoPost"] = sucesso ? $"success,Tarefa <b>{tarefa.Titulo}</b> excluída com sucesso :)" : $"error,Ocorreu um erro ao tentar excluir a tarefa <b>{tarefa.Titulo}</b> :("; return(RedirectToAction("Index")); }
public IActionResult OnPost() { _tarefaAppService.Remover(Tarefa.Id); return(RedirectToPage("Listar")); }