-
Notifications
You must be signed in to change notification settings - Fork 447
C#客户端 IQuery查询表达式
Yenan Wang edited this page Sep 29, 2016
·
1 revision
IQuery系列API专用于数据库的查询操作,最初出现的目的是为了封装数据库差异,几乎可以无缝切换后端的数据库;API设计上使用了类似于LINQ扩展方法的风格,可读性强,简洁易用。
- 注意:对SQL性能有严格要求的场景,请不要使用IQuery系列API,请使用支持自定义SQL的API。
var query = dao.GetQuery<Test>();
query.GreaterThan(p => p.Id, test.Id).And().Equal(p => p.NAME, test.NAME);
var result = dao.SelectList<Test>(query);
IQuery<T> Constrain(String column)
IQuery<T> Constrain(IQuery query)
IQuery<T> Constrain(Expression<Func<T, Object>> propertyExpression)
IQuery<T> And()
IQuery<T> Or()
IQuery<T> Not()
IQuery<T> Equal(Object val)
IQuery<T> Equal(String fieldName, Object val)
IQuery<T> Equal(Expression<Func<T, Object>> propertyExpression, Object val)
IQuery<T> EqualNullable(String fieldName, Object val)
IQuery<T> EqualNullable(Expression<Func<T, Object>> propertyExpression, Object val)
IQuery<T> NotEqual(Object val)
IQuery<T> NotEqual(String fieldName, Object val)
IQuery<T> NotEqual(Expression<Func<T, Object>> propertyExpression, Object val)
IQuery<T> NotEqualNullable(String fieldName, Object val)
IQuery<T> NotEqualNullable(Expression<Func<T, Object>> propertyExpression, Object val)
IQuery<T> Greater(Object val)
IQuery<T> GreaterThan(String fieldName, Object val)
IQuery<T> GreaterThan(Expression<Func<T, Object>> propertyExpression, Object val)
IQuery<T> GreaterThanNullable(String fieldName, Object val)
IQuery<T> GreaterEqual(Object val)
IQuery<T> GreaterThanEquals(String fieldName, Object val)
IQuery<T> GreaterThanEquals(Expression<Func<T, Object>> propertyExpression, Object val)
IQuery<T> GreaterThanEqualsNullable(String fieldName, Object val)
IQuery<T> Less(Object val)
IQuery<T> LessThan(String fieldName, Object val)
IQuery<T> LessThan(Expression<Func<T, Object>> propertyExpression, Object val)
IQuery<T> LessThanNullable(String fieldName, Object val)
IQuery<T> LessEqual(Object val)
IQuery<T> LessThanEquals(String fieldName, Object val)
IQuery<T> LessThanEquals(Expression<Func<T, Object>> propertyExpression, Object val)
IQuery<T> LessThanEqualsNullable(String fieldName, Object val)
IQuery<T> IsNull(String fieldName)
IQuery<T> IsNotNull(String fieldName)
IQuery<T> In(IList values)
IQuery<T> In(String fieldName, IList values)
IQuery<T> InNullable(String fieldName, IList paramValues)
IQuery<T> InNullable(Expression<Func<T, Object>> propertyExpression, IList paramValues)
IQuery<T> NotIn(IList values)
IQuery<T> Like(String val)
IQuery<T> Like(String fieldName, Object val)
IQuery<T> LikeNullable(String fieldName, String val)
IQuery<T> LikeNullable(Expression<Func<T, Object>> propertyExpression, String val)
IQuery<T> Between(Object start, Object end)
IQuery<T> Between(String fieldName, Object start, Object end)
IQuery<T> BetweenNullable(String fieldName, Object val, Object val2)
IQuery<T> BetweenNullable(Expression<Func<T, Object>> propertyExpression, Object val, Object val2)
IQuery<T> Order(String column, Boolean ascending)
IQuery<T> Order(Expression<Func<T, Object>> propertyExpression, Boolean asc)
IQuery<T> Paging(Int32 pageNumber, Int32 pageSize, String orderColumnName, Boolean isAscending)
IQuery<T> Paging(Int32 pageNumber, Int32 pageSize, Expression<Func<T, Object>> propertyExpression, Boolean isAscending)
IConstraint Get(Int32 index)
IQuery<T> LeftBracket()
IQuery<T> RightBracket()
IQuery<T> Limit(Int32 num1, Int32 num2 = 0)