/// <summary> /// Determine the type of either (1) the identifier if we reference the /// associated entity's PK or (2) the unique key to which we refer (i.e. /// the property-ref). /// </summary> /// <param name="factory">The mappings... </param> /// <returns> The appropriate type. </returns> public IType GetIdentifierOrUniqueKeyType(IMapping factory) { if (IsReferenceToPrimaryKey) { return(GetIdentifierType(factory)); } else { IType type = factory.GetReferencedPropertyType(GetAssociatedEntityName(), uniqueKeyPropertyName); if (type.IsEntityType) { type = ((EntityType)type).GetIdentifierOrUniqueKeyType(factory); } return(type); } }
/// <summary> /// Determine the type of either (1) the identifier if we reference the /// associated entity's PK or (2) the unique key to which we refer (i.e. /// the property-ref). /// </summary> /// <param name="factory">The mappings... </param> /// <returns> The appropriate type. </returns> public IType GetIdentifierOrUniqueKeyType(IMapping factory) { if (IsReferenceToPrimaryKey) { return GetIdentifierType(factory); } else { IType type = factory.GetReferencedPropertyType(GetAssociatedEntityName(), uniqueKeyPropertyName); if (type.IsEntityType) { type = ((EntityType)type).GetIdentifierOrUniqueKeyType(factory); } return type; } }