Exemple #1
0
        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());
        }
Exemple #2
0
 public void Excluir(Lancamentos id)
 {
     repository.Delete(id);
 }