Example #1
0
 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;
     }
 }
Example #2
0
 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;
 }