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 }); }
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 }); }
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 }; }
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 }); }