/// <summary> /// 定义两个实体类间的关系。 /// </summary> /// <param name="thisType"></param> /// <param name="otherType"></param> /// <param name="keyExpression"></param> public void DefineRelation(Type thisType, Type otherType, string keyExpression) { var relationName = string.Format("{0}_{1}:{2}", thisType.Name, otherType.Name, keyExpression); m_assemblyBuilder.SetCustomAttribute(() => new RelationshipAttribute(relationName, thisType, otherType, keyExpression)); }
/// <summary> /// 定义两个实体类间的关系。 /// </summary> /// <param name="thisType"></param> /// <param name="otherType"></param> /// <param name="keyExpression"></param> public void DefineRelation(Type thisType, Type otherType, string keyExpression) { var relationName = $"{thisType.Name}_{otherType.Name}:{keyExpression}"; _assemblyBuilder.SetCustomAttribute(() => new RelationshipAttribute(relationName, thisType, otherType, keyExpression)); }