Skip to content

Commit 063a1ca

Browse files
authored
Update README.md
1 parent 94dda8f commit 063a1ca

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ public class Startup
3838
> How to use in a controller
3939
4040
```csharp
41+
42+
[HttpGet]
43+
public IQueryExecutionResult Get(
44+
[FromServices]YourContext context,
45+
[FromServices]IQueryHandler handler,
46+
[FromServices]IQueryCriteria criteria,
47+
int? page = null,
48+
int? pageSize = null)
49+
{
50+
criteria.Page = page;
51+
criteria.PageSize = pageSize;
52+
IQueryable<OfSomething> query = context.Somethings;
53+
var result = handler.Execute(query, criteria);
54+
return result;
55+
}
56+
4157
[HttpPost]
4258
public IQueryExecutionResult Read(
4359
[FromServices]YourContext context,

0 commit comments

Comments
 (0)