public async Task <IActionResult> Delete(int id) { try { var deletado = await _repo.GetAllTarefasAsyncById(id); if (deletado == null) { return(NotFound()); } _repo.Delete(deletado); if (await _repo.SaveChangesAsync()) { return(Ok()); } } catch (System.Exception) { return(this.StatusCode(StatusCodes.Status500InternalServerError, "Banco de dados falhou")); } return(BadRequest()); }
public IActionResult Delete(string id, [FromServices] ITarefaRepository repository) { repository.Delete(new Guid(id)); return(Ok()); }
public IActionResult Delete([FromBody] Guid Id, [FromServices] ITarefaRepository repository) { repository.Delete(Id); return(Ok()); }
public IActionResult Delete([FromRoute] int id) { _tarefaRepository.Delete(id); return(Ok()); }
public void Excluir(Guid id) { _tarefaRepository.Delete(id); _unitOfWork.Complete(); }