public void RemoveActivity(Guid eventId) { var activity = EventActivities.SingleOrDefault(e => e.EventId == eventId); if (activity is null) { return; } EventActivities.Remove(activity); }
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; }
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); }
public bool IsRegisteredOnEvent(Guid eventId) { return(EventActivities .SingleOrDefault(x => x.EventId == eventId) is not null); }