public async Task Delete(Guid eventToCancelUuid, UserHelper requestingUser) { if (eventToCancelUuid == Guid.Empty) { throw new NoNullAllowedException(); } EventDto dbEvent = await _eventDal.Find(eventToCancelUuid); if (dbEvent == null) { throw new NoNullAllowedException(); } if (dbEvent.AuthorUuid != requestingUser.Uuid) { throw new UnauthorizedAccessException(); } List <Guid> usersToNotify = dbEvent.EventDates .SelectMany(e => e.EventDateUsers .Select(u => u.UserUuid)) .ToList(); NotifyUsersAboutDeletedEvent(usersToNotify, dbEvent.Title); await _eventDal.Delete(dbEvent); }
public IResult Delete(Event entity) { try { _eventDal.Delete(entity); return(new SuccessResult("İşlem başarılı")); } catch (Exception e) { return(new ErrorResult(e.Message)); } }
public void Delete(Event entity) { _postDal.Delete(entity); }
public int Delete(int id) { return(_eventDal.Delete(id)); }