コード例 #1
0
ファイル: MemberMapping.cs プロジェクト: shumtn/skynet-cloud
 private void InitializeAssociationAttribute(bool isEnumerableType, AbstractAssociationAttribute association)
 {
     isManyToOne = association.isForeignKey;
     if (isEnumerableType)
     {
         if (isManyToOne)
         {
             throw new MappingException("Foreign Key member type should be entity class not collection type.");
         }
         relatedEntityType = ReflectionHelper.GetElementType(memberType);
     }
     else
     {
         relatedEntityType = memberType;
     }
     thisKey  = association.ThisKey;
     otherKey = association.OtherKey;
     if (relatedEntityType == entity.entityType)
     {
         relatedEntity = entity;
     }
 }
コード例 #2
0
ファイル: MemberMapping.cs プロジェクト: CMONO/elinq
 private void InitializeAssociationAttribute(bool isEnumerableType, AbstractAssociationAttribute association)
 {
     isManyToOne = association.isForeignKey;
     if (isEnumerableType)
     {
         if (isManyToOne)
             throw new MappingException("Foreign Key member type should be entity class not collection type.");
         relatedEntityType = ReflectionHelper.GetElementType(memberType);
     }
     else
     {
         relatedEntityType = memberType;
     }
     thisKey = association.ThisKey;
     otherKey = association.OtherKey;
     if (relatedEntityType == entity.entityType)
         relatedEntity = entity;
 }