public async Task <IActionResult> DeleteConfirmed(Guid id)
        {
            _disciplinaRepository.Remove(id);
            await _disciplinaRepository.SaveChangesAsync();

            return(RedirectToAction(nameof(Index)));
        }
Example #2
0
        public async Task <SubmitResult <Disciplina> > Remover(Guid id)
        {
            var entity = _disciplinaRepository.GetById(id);

            var result = new ExcluirDisciplinaValidator(_disciplinaRepository).Validate(entity);

            if (result.IsValid)
            {
                _disciplinaRepository.Remove(id);
                await _uow.CommitAsync();
            }

            return(new SubmitResult <Disciplina>(entity, result));
        }
Example #3
0
        public IActionResult Delete([FromRoute] int id)
        {
            var disciplina = _repository.GetById(id);

            if (disciplina == null)
            {
                return(NotFound());
            }

            _repository.Remove(disciplina);
            _repository.SaveChanges();

            return(NoContent());
        }
 public void Remove(Guid obj)
 {
     _disciplinaRepository.Remove(obj);
 }