/// <summary>
 /// 获取列
 /// </summary>
 /// <typeparam name="TEntity">实体类型</typeparam>
 /// <param name="column">列名</param>
 private string GetColumn <TEntity>(Expression <Func <TEntity, object> > column) =>
 GetColumn(typeof(TEntity), _resolver.GetColumn(column));
        /// <summary>
        /// 设置Is Not Null条件
        /// </summary>
        /// <param name="expression">列名表达式</param>
        public void IsNotNull <TEntity>(Expression <Func <TEntity, object> > expression) where TEntity : class
        {
            var column = _helper.GetColumn(_resolver.GetColumn(expression), typeof(TEntity));

            IsNotNull(column);
        }
        /// <summary>
        /// 求总行数
        /// </summary>
        /// <typeparam name="TEntity">实体类型</typeparam>
        /// <param name="expression">列名表达式</param>
        /// <param name="columnAlias">列别名</param>
        public void Count <TEntity>(Expression <Func <TEntity, object> > expression, string columnAlias = null) where TEntity : class
        {
            var column = _resolver.GetColumn(expression);

            Count(column, columnAlias);
        }
Beispiel #4
0
 /// <summary>
 /// 获取处理后的列名
 /// </summary>
 /// <param name="expression">表达式</param>
 /// <param name="type">实体类型</param>
 /// <returns></returns>
 public string GetColumn(Expression expression, Type type)
 {
     return(GetColumn(_resolver.GetColumn(expression, type), type));
 }
Beispiel #5
0
 /// <summary>
 /// 设置查询条件
 /// </summary>
 /// <param name="expression">列名表达式</param>
 /// <param name="value">值</param>
 /// <param name="operator">运算符</param>
 public void Where <TEntity>(Expression <Func <TEntity, object> > expression, object value, Operator @operator = Operator.Equal) where TEntity : class
 {
     Where(GetColumn(_resolver.GetColumn(expression), typeof(TEntity)), value, @operator);
 }