public EventManager(IEventRegistrationPolicy registrationPolicy, IRepository <EventRegistration> eventRegistrationRepository, IRepository <Event, Guid> eventRepository)
        {
            this.registrationPolicy          = registrationPolicy;
            this.eventRegistrationRepository = eventRegistrationRepository;
            this.eventRepository             = eventRepository;

            EventBus = NullEventBus.Instance;
        }
Esempio n. 2
0
        public EventManager(IEventRegistrationPolicy registrationPolicy, IRepository <EventRegistration> eventRegRepo, IRepository <Event, Guid> eventRepo)
        {
            _registrationPolicy = registrationPolicy;
            _eventRegRepo       = eventRegRepo;
            _eventRepo          = eventRepo;

            _eventBus = NullEventBus.Instance;
        }
Esempio n. 3
0
        public EventManager(
            IEventRegistrationPolicy registrationPolicy,
            IRepository <EventRegistration, int> eventRegistrationRepository,
            IRepository <Event, Guid> eventRepository)
        {
            _registrationPolicy          = registrationPolicy;
            _eventRegistrationRepository = eventRegistrationRepository;
            _eventRepository             = eventRepository;

            EventBus = NullEventBus.Instance; //init default Service Bus
        }
Esempio n. 4
0
        public EventManager(
            IEventRegistrationPolicy registrationPolicy,
            IRepository<EventRegistration> eventRegistrationRepository,
            IRepository<Event, Guid> eventRepository)
        {
            _registrationPolicy = registrationPolicy;
            _eventRegistrationRepository = eventRegistrationRepository;
            _eventRepository = eventRepository;

            EventBus = NullEventBus.Instance;
        }
Esempio n. 5
0
        public async static Task<EventRegistration> CreateAsync(Event @event, User user, IEventRegistrationPolicy registrationPolicy)
        {
            if (@event == null) { throw new ArgumentNullException("event"); }
            if (user == null) { throw new ArgumentNullException("user"); }

            await registrationPolicy.CheckRegistrationAttemptAsync(@event, user);

            return new EventRegistration
            {
                TenantId = @event.TenantId,
                EventId = @event.Id,
                Event = @event,
                UserId = @user.Id,
                User = user
            };
        }
Esempio n. 6
0
        public static async Task <EventRegistration> CreateAsync(CreekEvent @event, User user, IEventRegistrationPolicy registrationPolicy)
        {
            await registrationPolicy.CheckRegistrationAttemptAsync(@event, user);

            return(new EventRegistration
            {
                TenantId = @event.TenantId,
                EventId = @event.Id,
                Event = @event,
                UserId = @user.Id,
                User = user
            });
        }
Esempio n. 7
0
        public async static Task <EventRegistration> CreateAsync(Event @event, User user, IEventRegistrationPolicy registrationPolicy)
        {
            if (@event == null)
            {
                throw new ArgumentNullException("event");
            }
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }
            if (registrationPolicy == null)
            {
                throw new ArgumentNullException("registrationPolicy");
            }

            await registrationPolicy.CheckRegistrationAttemptAsync(@event, user);

            return(new EventRegistration
            {
                TenantId = @event.TenantId,
                EventId = @event.Id,
                Event = @event,
                UserId = @user.Id,
                User = user
            });
        }
Esempio n. 8
0
        public static async Task <EventRegistration> CreateAsync(Event @event, User user, IEventRegistrationPolicy registrationPolicy)
        {
            if (!await registrationPolicy.CheckRegistrationAttemptAsync(@event, user))
            {
                return(null);
            }

            return(new EventRegistration()
            {
                TenantId = @event.TenantId,
                EventId = @event.Id,
                Event = @event,
                UserId = user.Id,
                User = user
            });
        }