Skip to content

Commit 94dda8f

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

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ public class Startup
3535

3636
```
3737

38+
> How to use in a controller
39+
40+
```csharp
41+
[HttpPost]
42+
public IQueryExecutionResult Read(
43+
[FromServices]YourContext context,
44+
[FromServices]IQueryHandler handler,
45+
[FromBody]IQueryCriteria criteria)
46+
{
47+
IQueryable<OfSomething> query = context.Somethings;
48+
var result = handler.Execute(query, criteria);
49+
return result;
50+
}
51+
```
52+
3853
### Sample Web Project - ASP.NET CORE + EF Core
3954

4055
Visit: https://github.com/PoweredSoft/DynamicQueryAspNetCoreSample
@@ -134,4 +149,4 @@ IAggregateInterceptor | [interface](../master/PoweredSoft.DynamicQuery.Core/IAgg
134149
Interceptor | Interface | Example | Description
135150
----------------------------------|---------------------------------------------------------------------------------------|-------------------------------------------------------------|------------------------------------------------------------------------------------------------
136151
IQueryConvertInterceptor | [interface](../master/PoweredSoft.DynamicQuery.Core/IQueryConvertInterceptor.cs) | [test](../master/PoweredSoft.DynamicQuery.Test/ConvertibleInterceptorTests.cs) | This interceptor allows you to replace the object that is being returned by the query, by another object instance
137-
IQueryConvertInterceptor&lt;T&gt; | [interface](../master/PoweredSoft.DynamicQuery.Core/IQueryConvertInterceptor.cs) | [test](../master/PoweredSoft.DynamicQuery.Test/ConvertibleInterceptorTests.cs#L72) | This interceptor allows you to replace the object that is being returned by the query, by another object instance
152+
IQueryConvertInterceptor&lt;T&gt; | [interface](../master/PoweredSoft.DynamicQuery.Core/IQueryConvertInterceptor.cs) | [test](../master/PoweredSoft.DynamicQuery.Test/ConvertibleInterceptorTests.cs#L72) | This interceptor allows you to replace the object that is being returned by the query, by another object instance

0 commit comments

Comments
 (0)