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

            if (activity is null)
            {
                return;
            }
            EventActivities.Remove(activity);
        }
示例#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;
        }
示例#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);
        }
示例#4
0
 public bool IsRegisteredOnEvent(Guid eventId)
 {
     return(EventActivities
            .SingleOrDefault(x => x.EventId == eventId) is not null);
 }