Exemple #1
0
        public MemberMapping(MemberInfo memberInfo, MemberAttribute memberAttribute, IEntityMapping entityMapping)
        {
            this.entity = entityMapping;

            this.memberInfo = memberInfo;

            this.memberAttribute = memberAttribute;

            this.memberType = memberInfo.GetMemberType();

            if (memberAttribute is ColumnAttribute)
            {
                this.InitializeColumnAttributeMapping((ColumnAttribute)memberAttribute);
            }
            else if (memberAttribute is AssociationAttribute)
            {
                var isEnumerableType = memberType != typeof(string) &&
                                       memberType != typeof(byte[]) &&
                                       typeof(IEnumerable).IsAssignableFrom(memberType);

                this.isRelationship = true;

                this.InitializeAssociationAttributeMapping((AssociationAttribute)memberAttribute, isEnumerableType);
            }
        }
Exemple #2
0
        public MemberMapping(MemberInfo memberInfo,  MemberAttribute memberAttribute, IEntityMapping entityMapping)
        {
            this.entity = entityMapping;

            this.memberInfo = memberInfo;

            this.memberAttribute = memberAttribute;

            this.memberType = memberInfo.GetMemberType();

            if (memberAttribute is ColumnAttribute)
            {
                this.InitializeColumnAttributeMapping((ColumnAttribute)memberAttribute);
            }
            else if (memberAttribute is AssociationAttribute)
            {
                var isEnumerableType = memberType != typeof(string) &&
                                       memberType != typeof(byte[]) &&
                                       typeof(IEnumerable).IsAssignableFrom(memberType);

                this.isRelationship = true;

                this.InitializeAssociationAttributeMapping((AssociationAttribute)memberAttribute, isEnumerableType);
            }
        }