果糖网
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
16 additions and
0 deletions
-
README.md
|
|
@ -136,3 +136,19 @@ public static SqlSugarScope Db = new SqlSugarScope(new ConnectionConfig() |
|
|
|
tran.CommitTran();//这个提交不能漏掉 |
|
|
|
} |
|
|
|
``` |
|
|
|
### Query Filter |
|
|
|
```cs |
|
|
|
//set Filter |
|
|
|
db.QueryFilter.Add(new TableFilterItem<Order>(it => it.Name.Contains("a"))); //为Order表置全局条件 |
|
|
|
|
|
|
|
|
|
|
|
db.Queryable<Order>().ToList(); |
|
|
|
//SELECT [Id],[Name],[Price],[CreateTime],[CustomId] FROM [Order] WHERE ([Name] like '%'+@MethodConst0+'%') |
|
|
|
|
|
|
|
db.Queryable<OrderItem, Order>((i, o) => i.OrderId == o.Id) |
|
|
|
.Where(i => i.OrderId != 0) |
|
|
|
.Select("i.*").ToList(); |
|
|
|
//SELECT i.* FROM [OrderDetail] i ,[Order] o WHERE ( [i].[OrderId] = [o].[Id] ) AND |
|
|
|
//( [i].[OrderId] <> @OrderId0 ) AND ([o].[Name] like '%'+@MethodConst1+'%') |
|
|
|
|
|
|
|
``` |
|
|
|