Exemple #1
0
        internal static void MapTo(this Member member, MemberEntity entity)
        {
            member.MapTo(entity.RegisteredUserEntity);
            member.MapTo((IHaveEmailAddressesEntity)entity.RegisteredUserEntity);
            member.MapTo((IHavePhoneNumbersEntity)entity);
            entity.lastEditedTime = member.LastUpdatedTime;
            entity.gender         = (byte)member.Gender;
            member.DateOfBirth.MapTo(entity);
            entity.ethnicFlags    = member.EthnicStatus == 0 ? null : (int?)member.EthnicStatus;
            entity.profilePhotoId = member.PhotoId;

            entity.firstDegreeAccess  = (int)member.VisibilitySettings.Personal.FirstDegreeVisibility;
            entity.secondDegreeAccess = (int)member.VisibilitySettings.Personal.SecondDegreeVisibility;
            entity.publicAccess       = (int)member.VisibilitySettings.Personal.PublicVisibility;
            entity.employerAccess     = (byte)member.VisibilitySettings.Professional.EmploymentVisibility;

            if (entity.AddressEntity == null)
            {
                entity.AddressEntity = member.Address.MapTo <AddressEntity, LocationReferenceEntity>();
            }
            else
            {
                member.Address.MapTo(entity.AddressEntity);
            }
        }
Exemple #2
0
        internal static MemberEntity Map(this Member member)
        {
            var entity = new MemberEntity
            {
                id = member.Id,
                RegisteredUserEntity = new RegisteredUserEntity {
                    id = member.Id
                },
            };

            member.MapTo(entity);
            return(entity);
        }