internal AttributedMetaType(Type classType)
        {
            type = classType;

			AssociationsLookup = new Dictionary<MemberInfo, MetaDataMember>();
			_AssociationFixupList = new List<AssociationData>();

			//First add the member to the AssociationsLookup table, because creation of the Association will cause both meta classes to look each other up, or possibly a self lookup
			//We'll also cache the association data in _AssociationFixupList to be used by GetAssociations
			foreach (var memberInfo in type.GetMembers())
			{
				var association = memberInfo.GetAttribute<AssociationAttribute>();
				if (association == null)
					continue;
				var dataMember = new AttributedAssociationMetaDataMember(memberInfo, association, this);
				AssociationsLookup[memberInfo] = dataMember;
				_AssociationFixupList.Add(new AssociationData() { Association = association, Member = memberInfo, DataMember = dataMember });
			}
        }
Esempio n. 2
0
        internal AttributedMetaType(Type classType)
        {
            type = classType;

            AssociationsLookup    = new Dictionary <MemberInfo, MetaDataMember>();
            _AssociationFixupList = new List <AssociationData>();

            //First add the member to the AssociationsLookup table, because creation of the Association will cause both meta classes to look each other up, or possibly a self lookup
            //We'll also cache the association data in _AssociationFixupList to be used by GetAssociations
            foreach (var memberInfo in type.GetMembers())
            {
                var association = memberInfo.GetAttribute <AssociationAttribute>();
                if (association == null)
                {
                    continue;
                }
                var dataMember = new AttributedAssociationMetaDataMember(memberInfo, association, this);
                AssociationsLookup[memberInfo] = dataMember;
                _AssociationFixupList.Add(new AssociationData()
                {
                    Association = association, Member = memberInfo, DataMember = dataMember
                });
            }
        }