Example #1
0
 /// <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();
        }
Example #3
0
 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"));
 }
Example #6
0
 public IActionResult Delete(int id)
 {
     _conferenceRepository.Delete(id);
     return(Ok());
 }