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