Update README.md

This commit is contained in:
dlebee 2018-11-18 05:53:11 -06:00 committed by GitHub
parent 94dda8f85d
commit 063a1cad61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,22 @@ public class Startup
> How to use in a controller
```csharp
[HttpGet]
public IQueryExecutionResult Get(
[FromServices]YourContext context,
[FromServices]IQueryHandler handler,
[FromServices]IQueryCriteria criteria,
int? page = null,
int? pageSize = null)
{
criteria.Page = page;
criteria.PageSize = pageSize;
IQueryable<OfSomething> query = context.Somethings;
var result = handler.Execute(query, criteria);
return result;
}
[HttpPost]
public IQueryExecutionResult Read(
[FromServices]YourContext context,