コード例 #1
0
        /// <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));
        }
コード例 #2
0
        /// <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));
        }