Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public IResult Delete(Event entity)
 {
     try
     {
         _eventDal.Delete(entity);
         return(new SuccessResult("İşlem başarılı"));
     }
     catch (Exception e)
     {
         return(new ErrorResult(e.Message));
     }
 }
Exemplo n.º 3
0
 public void Delete(Event entity)
 {
     _postDal.Delete(entity);
 }
Exemplo n.º 4
0
 public int Delete(int id)
 {
     return(_eventDal.Delete(id));
 }