/// <summary> /// Apply an "in" constraint to the named property (Dapper.Net) /// </summary> /// <typeparam name="TEntity"></typeparam> /// <param name="expression"></param> /// <param name="values"></param> /// <param name="paramName"></param> /// <returns></returns> public static WhereClip DapperIn <TEntity, T>(Expression <Func <TEntity, object> > expression, IEnumerable <T> values, string paramName = null) where TEntity : class { string propertyName = SqlQueryUtils.GetPropertyName(expression); return(DapperIn(propertyName, values, paramName)); }
/// <summary> /// Apply a "between" constraint to the named property /// </summary> /// <param name="expression">The name of the Property in the class.</param> /// <param name="lo">The low value for the Property.</param> /// <param name="hi">The high value for the Property.</param> /// <returns>A <see cref="WhereClip" />.</returns> public static WhereClip Between <TEntity>(Expression <Func <TEntity, object> > expression, object lo, object hi, string paramName = null) where TEntity : class { string propertyName = SqlQueryUtils.GetPropertyName(expression); return(Between(propertyName, lo, hi, paramName)); }
/// <summary> /// 不为空 /// </summary> /// <param name="expression"></param> /// <returns></returns> public static WhereClip IsNotNull <TEntity>(Expression <Func <TEntity, object> > expression) where TEntity : class { string propertyName = SqlQueryUtils.GetPropertyName(expression); return(IsNotNull(propertyName)); }
/// <summary> /// Apply a "greater than or equal" constraint to the named property /// </summary> /// <param name="expression">The name of the Property in the class.</param> /// <param name="value">The value for the Property.</param> public static WhereClip Ge <TEntity>(Expression <Func <TEntity, object> > expression, object value, string paramName = null) where TEntity : class { string propertyName = SqlQueryUtils.GetPropertyName(expression); return(Ge(propertyName, value, paramName)); }
internal OrderByClip OrderBy <TEntity>(Expression <Func <TEntity, object> > expression, SortDirection sortDirection = SortDirection.Ascending) { string propertyName = SqlQueryUtils.GetPropertyName(expression); return(OrderBy(propertyName, sortDirection)); }