mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-04 07:20:51 +08:00
update
@@ -26,6 +26,15 @@ var list = fsql.Select<Topic>()
|
|||||||
.Tolist();
|
.Tolist();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> Count(out var total) is a synchronous method, because out does not support asynchrony. If you mind, you can execute it separately as follows:
|
||||||
|
|
||||||
|
```c#
|
||||||
|
var select = fsql.Select<Topic>()
|
||||||
|
.Where(a => a.Id > 10);
|
||||||
|
var total = await select.CountAsync();
|
||||||
|
var list = await select.Page(1, 20).ToListAsync();
|
||||||
|
```
|
||||||
|
|
||||||
## Optimization
|
## Optimization
|
||||||
|
|
||||||
For the previous versions of `SqlServer 2012`, use `row_number` for pagination;
|
For the previous versions of `SqlServer 2012`, use `row_number` for pagination;
|
||||||
|
|||||||
9
分页查询.md
9
分页查询.md
@@ -26,6 +26,15 @@ var list = fsql.Select<Topic>()
|
|||||||
.Tolist();
|
.Tolist();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> Count(out var total) 是同步方法,原因是 out 不支持异步,如果介意可以单独执行如下:
|
||||||
|
|
||||||
|
```c#
|
||||||
|
var select = fsql.Select<Topic>()
|
||||||
|
.Where(a => a.Id > 10);
|
||||||
|
var total = await select.CountAsync();
|
||||||
|
var list = await select.Page(1, 20).ToListAsync();
|
||||||
|
```
|
||||||
|
|
||||||
## 优化
|
## 优化
|
||||||
|
|
||||||
`SqlServer 2012` 以前的版本,使用 `row_number` 分页;
|
`SqlServer 2012` 以前的版本,使用 `row_number` 分页;
|
||||||
|
|||||||
Reference in New Issue
Block a user