public async Task <IActionResult> Delete(int Id) { try { var classRoom = await _repository.Delete(Id); return(Ok(classRoom)); } catch (Exception) { throw; } }
public ICommandResult Handle(DeleteClassRoomCommand command) { string id = command.Id.ToString(); if (string.IsNullOrEmpty(id)) { AddNotification("Id", "Identificador inválido"); } if (Invalid) { return(new CommandResult(false, "Erro ao deletar sala", Notifications)); } _repository.Delete(command); return(new CommandResult(true, "Sala deletada com sucesso", null)); }
public async Task <DeleteClassRoomResults> Delete(int id) { return(await classRoomRepository.Delete(id)); }
public int Delete(int id) { var ClassRoomToDelete = _classRoomRepository.GetById(id); return(_classRoomRepository.Delete(ClassRoomToDelete)); }