Exemplo n.º 1
0
        /// <summary>
        /// 设置连接条件
        /// </summary>
        /// <typeparam name="TLeft">左表实体类型</typeparam>
        /// <typeparam name="TRight">右表实体类型</typeparam>
        /// <param name="expression">条件表达式</param>
        public void On <TLeft, TRight>(Expression <Func <TLeft, TRight, bool> > expression) where TLeft : class where TRight : class
        {
            if (expression == null)
            {
                throw new ArgumentNullException(nameof(expression));
            }
            var expressions = Lambdas.GetGroupPredicates(expression);
            var items       = expressions.Select(GetOnItems).ToList();

            _params.LastOrDefault()?.On(items, _dialect);
        }