Exemple #1
0
        public Task <string> Save(ProfileSaveModel profile, CancellationToken cancellationToken)
        {
            var email = this.User.GetEmailAddress();

            return(this.mediator.Send(new SaveProfile(email, MapClub.Map(email, profile)),
                                      cancellationToken));
        }
Exemple #2
0
        public async Task <Entrant> PutEntrant(ulong eventId, ulong entrantId, EntrantSaveModel entrantSaveModel, CancellationToken cancellationToken)
        {
            var currentUserEmail = this.User.GetEmailAddress();

            if (await this.mediator.Send(new IsClubAdmin(eventId, currentUserEmail), cancellationToken))
            {
                return(await this.mediator.Send(new SaveEntrant(MapClub.Map(entrantId, eventId, entrantSaveModel, entrantSaveModel.Email)),
                                                cancellationToken));
            }
            else
            {
                return(await this.mediator.Send(new SaveEntrant(MapClub.Map(entrantId, eventId, entrantSaveModel, currentUserEmail)),
                                                cancellationToken));
            }
        }
Exemple #3
0
 public Task <ulong> Save(ulong eventId, EventSaveModel @event, CancellationToken cancellationToken) =>
 this.mediator.Send(new SaveEvent(MapClub.Map(eventId, @event)), cancellationToken);
Exemple #4
0
        public Task Add(ulong notificationId, ulong eventId, NotificationSaveModel notification, CancellationToken cancellationToken)
        {
            var email = this.User.GetEmailAddress();

            return(mediator.Send(new AddNotification(MapClub.Map(notificationId, eventId, email, notification)), cancellationToken));
        }
Exemple #5
0
 public Task <ulong> Save(ulong clubId, ClubSaveModel club, CancellationToken cancellationToken) =>
 this.mediator.Send(new SaveClub(MapClub.Map(clubId, club)), cancellationToken);