/// <summary> /// Delete a conference /// </summary> public void deleteConferences() { foreach (Conference conference in ConferenceRepository.All()) { ConferenceRepository.Delete(conference); } }
public async Task DeleteAsync(Guid id) { var conference = await _conferenceRepository.GetAsync(id); if (conference is null) { throw new ConferenceNotFoundException(id); } if (!await _conferenceDeletionPolicy.CanDeleteAsync(conference)) { throw new CannotDeleteConferenceException(id); } _conferenceRepository.Delete(conference); await _conferenceRepository.UnitOfWork.SaveChangesAsync(); }
public Task <Unit> Handle(Command request, CancellationToken cancellationToken) { repository.Delete(request.ConferenceId); return(Unit.Task); }
public IActionResult Delete(int id) { repository.Delete(id); return(RedirectToAction("Index")); }
public IActionResult Delete(int id) { _conferenceRepository.Delete(id); return(RedirectToAction("Index", "Conference")); }
public IActionResult Delete(int id) { _conferenceRepository.Delete(id); return(Ok()); }