public static Member Map <TAddressEntity, TLocationReferenceEntity>(this IMemberEntity <TAddressEntity, TLocationReferenceEntity> memberEntity, IRegisteredUserEntity registeredUserEntity, ICommunityMemberEntity communityMemberEntity, ILocationQuery locationQuery) where TAddressEntity : class, IAddressEntity <TLocationReferenceEntity> where TLocationReferenceEntity : class, ILocationReferenceEntity { var member = registeredUserEntity.MapTo <Member>(); ((IHaveEmailAddressesEntity)registeredUserEntity).MapTo(member); memberEntity.MapTo(member); member.LastUpdatedTime = memberEntity.lastEditedTime; member.Gender = (Gender)memberEntity.gender; member.DateOfBirth = memberEntity.Map(); member.EthnicStatus = (EthnicStatus)(memberEntity.ethnicFlags == null ? 0 : memberEntity.ethnicFlags.Value); member.Address = memberEntity.AddressEntity == null ? null : memberEntity.AddressEntity.Map(locationQuery); member.PhotoId = memberEntity.profilePhotoId; member.AffiliateId = communityMemberEntity == null ? (Guid?)null : communityMemberEntity.primaryCommunityId; member.VisibilitySettings = new VisibilitySettings { Personal = { FirstDegreeVisibility = (PersonalVisibility)memberEntity.firstDegreeAccess, SecondDegreeVisibility = (PersonalVisibility)memberEntity.secondDegreeAccess, PublicVisibility = (PersonalVisibility)memberEntity.publicAccess }, Professional = { EmploymentVisibility = (ProfessionalVisibility)memberEntity.employerAccess, } }; return(member); }
/// <inheritdoc /> public IMember Register( IMemberEntity memberEntity, out MembershipCreateStatus createStatus, LoginType loginType = LoginType.Standard, string profileImageUrl = null, string facebookUserAccessToken = null) { if (string.IsNullOrEmpty(profileImageUrl) && !string.IsNullOrEmpty(memberEntity.SocialProfileImageUrl)) { profileImageUrl = memberEntity.SocialProfileImageUrl; } return(Register( memberEntity.UserName, memberEntity.Email, memberEntity.FirstName, memberEntity.LastName, memberEntity.Password, out createStatus, loginType, profileImageUrl, facebookUserAccessToken)); }