Пример #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));
        }
Пример #2
0
        public static Profile Map(string emailAddress, ProfileSaveModel profile)
        {
            var p = new Profile(emailAddress, profile.GivenName, profile.FamilyName, profile.Age);

            p.SetVehicle(Map(profile.Vehicle));
            p.SetEmergencyContact(Map(profile.EmergencyContact));
            p.SetClubMemberships(profile.ClubMemberships.Select(Map).ToArray());
            p.SetMsaMembership(Map(profile.MsaMembership));
            return(p);
        }