예제 #1
0
        /// <summary>
        /// lambda添加或者条件
        /// </summary>
        /// <param name="where"></param>
        public void OrWhere(Expression <Func <T, bool> > where)
        {
            if (where == null)
            {
                return;
            }
            var WhereStr = SqlSugor.GetWhereByLambda(where);

            if (String.IsNullOrWhiteSpace(_SELECTWhere))
            {
                _SELECTWhere = WhereStr;
                return;
            }
            _SELECTWhere = $" ({_SELECTWhere})  {SqlModel.OR} ({WhereStr})";
        }
예제 #2
0
        /// <summary>
        /// lambda设置条件
        /// </summary>
        /// <param name="where"></param>
        public void SetWhere(Expression <Func <T, bool> > where)
        {
            var Where = SqlSugor.GetWhereByLambda(where);

            _SELECTWhere = Where;
        }