Exemplo n.º 1
0
 /// <summary>
 /// Delete a conference
 /// </summary>
 public void deleteConferences()
 {
     foreach (Conference conference in ConferenceRepository.All())
     {
         ConferenceRepository.Delete(conference);
     }
 }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
 public Task <Unit> Handle(Command request, CancellationToken cancellationToken)
 {
     repository.Delete(request.ConferenceId);
     return(Unit.Task);
 }
Exemplo n.º 4
0
 public IActionResult Delete(int id)
 {
     repository.Delete(id);
     return(RedirectToAction("Index"));
 }
 public IActionResult Delete(int id)
 {
     _conferenceRepository.Delete(id);
     return(RedirectToAction("Index", "Conference"));
 }
Exemplo n.º 6
0
 public IActionResult Delete(int id)
 {
     _conferenceRepository.Delete(id);
     return(Ok());
 }