Example #1
0
        public void RemoveActivity(Guid eventId)
        {
            var activity = EventActivities.SingleOrDefault(e => e.EventId == eventId);

            if (activity is null)
            {
                return;
            }
            EventActivities.Remove(activity);
        }
Example #2
0
        public void ChangeActivityStatus(Guid eventId, string activityStatus)
        {
            var activity = EventActivities.SingleOrDefault(e => e.EventId == eventId);

            if (activity is null)
            {
                throw new DomainException(DomainExceptionMessage.Event.UserNotRegisteredForEvent);
            }
            activity.Status = activityStatus;
        }
Example #3
0
        public bool CanRegisterOnEvent(Guid eventId)
        {
            var eventActivity = EventActivities
                                .SingleOrDefault(x => x.EventId == eventId);

            if (eventActivity is null)
            {
                return(true);
            }
            if (eventActivity.Status == EventActivityStatus.Left)
            {
                return(true);
            }
            return(false);
        }
Example #4
0
 public bool IsRegisteredOnEvent(Guid eventId)
 {
     return(EventActivities
            .SingleOrDefault(x => x.EventId == eventId) is not null);
 }