Open cissemy opened 7 years ago
Yes, since it is just a wrapper around ADO.NET. However, note that the functions that generates OData and JQuery DataTable responses as JSON rely on FOR JSON clause that is available only in SQL2016.
Hi, In your rest api you only implemented R part of CRUD: // GET api/People/Load [HttpGet("Load")] public async Task Load() { await sqlQuery.Stream("select * from people for json path", Response.Body, "[]"); } How to implement Create and Update and Delete?
You can a create stored procedure that parses input JSON using OPENJSON and insert it into a table. Take a look at SQL Server GitHub samples:
Instead of stored procedure, you can directly embed the SQL in code.
Thank you. This way I do not need MongoDB.
On Wed, Oct 4, 2017 at 10:48 AM, Jovan Popovic notifications@github.com wrote:
You can a create stored procedure that parses input JSON using OPENJSON and insert it into a table. Take a look at SQL Server GitHub samples:
- Controller: https://github.com/Microsoft/sql-server-samples/blob/ master/samples/features/json/product-catalog/dotnet-rest- api/Controllers/ProductController.cs https://github.com/Microsoft/sql-server-samples/blob/master/samples/features/json/product-catalog/dotnet-rest-api/Controllers/ProductController.cs
- DB&procedures: https://github.com/Microsoft/sql-server-samples/blob/ master/samples/features/json/product-catalog/dotnet-rest- api/sql-scripts/setup.sql https://github.com/Microsoft/sql-server-samples/blob/master/samples/features/json/product-catalog/dotnet-rest-api/sql-scripts/setup.sql
Instead of stored procedure, you can directly embed the SQL in code.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JocaPC/sql-server-rest-api/issues/1#issuecomment-334180405, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFUiWnxTSUImxQhZ_bfm2X3jJuYRHJoks5so5q6gaJpZM4MTH3y .
-- CISSE M. Y. Sofware/Web Developer Phone :(347) 443-9028
Hi, I am trying to build the sample but i am getting the following error : attached file. Thanks
On Wed, Oct 4, 2017 at 10:48 AM, Jovan Popovic notifications@github.com wrote:
You can a create stored procedure that parses input JSON using OPENJSON and insert it into a table. Take a look at SQL Server GitHub samples:
- Controller: https://github.com/Microsoft/sql-server-samples/blob/ master/samples/features/json/product-catalog/dotnet-rest- api/Controllers/ProductController.cs https://github.com/Microsoft/sql-server-samples/blob/master/samples/features/json/product-catalog/dotnet-rest-api/Controllers/ProductController.cs
- DB&procedures: https://github.com/Microsoft/sql-server-samples/blob/ master/samples/features/json/product-catalog/dotnet-rest- api/sql-scripts/setup.sql https://github.com/Microsoft/sql-server-samples/blob/master/samples/features/json/product-catalog/dotnet-rest-api/sql-scripts/setup.sql
Instead of stored procedure, you can directly embed the SQL in code.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JocaPC/sql-server-rest-api/issues/1#issuecomment-334180405, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFUiWnxTSUImxQhZ_bfm2X3jJuYRHJoks5so5q6gaJpZM4MTH3y .
-- CISSE M. Y. Sofware/Web Developer Phone :(347) 443-9028
Hi, Can sql-server-rest-api work on sql server 2014 or before ?