Esempio n. 1
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. 2
0
        public static async Task <EventRegistration> CreateAsync(Event @event, User user, IEventRegistrationPolicy registrationPolicy)
        {
            await registrationPolicy.CheckRegistrationAttemptAsync(@event, user);

            return(new EventRegistration
            {
                EventId = @event.Id,
                Event = @event,
                UserId = @user.Id,
                User = user
            });
        }
Esempio n. 3
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. 4
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
            });
        }