You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+3-4
Original file line number
Diff line number
Diff line change
@@ -36,8 +36,6 @@ As a first step you need to setup IQueryPipe interface that will be used to exec
36
36
using Belgrade.SqlClient;
37
37
using System.Threading.Tasks;
38
38
39
-
// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
40
-
41
39
namespace Catalog.Controllers
42
40
{
43
41
[Route("api/[controller]")]
@@ -61,7 +59,7 @@ Now you need to create async method that will serve requests. The only thing tha
61
59
[HttpGet("Load")]
62
60
public async Task Load()
63
61
{
64
-
await sqlQuery.Stream("select name, surname, address, town from people for json path, root('data')", Response.Body, @"{""data"":[]");
62
+
await sqlQuery.Stream("select * from people for json path", Response.Body, "[]");
65
63
}
66
64
```
67
65
@@ -74,6 +72,7 @@ To implement OData Service, you would need to add the following fields in your c
74
72
- UriParser that will parse OData Http request and extract information from $select, $filter, $orderby, $top, and $skip parameters
75
73
- QueryBuilder that will create T-SQL query that will be executed.
76
74
75
+
Example is shown in the following code:
77
76
```
78
77
IQueryPipe sqlQuery = null;
79
78
@@ -87,7 +86,7 @@ To implement OData Service, you would need to add the following fields in your c
87
86
}
88
87
```
89
88
90
-
Now you need to create async method that will serve OData requests. First you need to parse Request parameters using UriParser in order to extract QuerySpec. Then you need to use QueryBuilder to create SQL query using the QuerySpec. Then you need to provide SqlQuery to QueryPipe that will stream results to client:
89
+
Now you need to create async method that will serve OData requests. First, you need to parse Request parameters using UriParser in order to extract QuerySpec. Then you need to use QueryBuilder to create SQL query using the QuerySpec. Then you need to provide sql query to QueryPipe that will stream results to client using Response.Body:
0 commit comments