Esempio n. 1
0
        internal static UserProfile Factory(Profile ProfileDefinition)
        {
            UserProfile profile = new UserProfile()
            {
                Id = Guid.Empty, ProfileDefinition = ProfileDefinition
            };

            foreach (ProfileField field in ProfileDefinition.Fields)
            {
                profile.Fields.Add(UserProfileField.Factory(Guid.Empty, ProfileDefinition.Id, field));
            }

            return(profile);
        }
Esempio n. 2
0
        internal static UserProfile Factory(Guid ContactId, EntityCollection Profiles, Profile ProfileDefinition)
        {
            UserProfile profile = new UserProfile()
            {
                Id = ContactId, ProfileDefinition = ProfileDefinition
            };

            foreach (Entity e in Profiles.Entities)
            {
                profile.Fields.Add(UserProfileField.Factory(e));
            }

            foreach (ProfileField field in ProfileDefinition.Fields.Except(ProfileDefinition.Fields.Where(x => Profiles.Entities.Any(y => y.GetAttributeValue <EntityReference>("appl_profilefieldid").Id.Equals(x.Id)))))
            {
                profile.Fields.Add(UserProfileField.Factory(ContactId, ProfileDefinition.Id, field));
            }

            return(profile);
        }