public async Task <IActionResult> Delete(int AlunoId, int DisciplinaId) { try { var lancamentos = await _repo.GetLancamentosById(AlunoId, DisciplinaId); if (lancamentos == null) { return(NotFound(MSG.NaoExisteLancamento)); } _repo.Delete(lancamentos); if (await _repo.SaveChangesAsync()) { return(Ok(MSG.DeleteLancamento)); } } catch (Exception) { return(this.StatusCode(StatusCodes.Status501NotImplemented, MSG.BancoDadosFalhou)); } return(BadRequest()); }
public void Excluir(Lancamentos id) { repository.Delete(id); }