update

2881099
2022-08-05 13:30:02 +08:00
parent ca1a06c8cc
commit 486b4ef4a0
2 changed files with 18 additions and 0 deletions

@@ -26,6 +26,15 @@ var list = fsql.Select<Topic>()
.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
For the previous versions of `SqlServer 2012`, use `row_number` for pagination;

@@ -26,6 +26,15 @@ var list = fsql.Select<Topic>()
.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` 分页;