I've used this article to build a REST API with Azure SQL database as a back-end, but am now getting CS0618 warnings:
'IQueryPipeExtensions.Stream(IQueryPipe, SqlCommand, Stream, string)' is obsolete: 'Use pipe.Sql(...).Stream(stream, defaultOutput) instead.'
'ICommandExtensions.Exec(ICommand, DbCommand)' is obsolete: 'Use command.Sql(...).Exec() instead.'
Some methods are rewritten and replaced with new methods in later versions of library. However, old methods are kept with warning just to avoid braking changes. My suggestion would be to replace old methods with the new ones.
thanks for this article so far.
But i have a problem with POST and PUT - i need to return data in the body, but as i call sql-data as you described, i will get no results on POST and PUT. I call a stored procedure which returns a json.
How to resolve this?
Sorry for the late reply. Could you describe what is wrong and could you reproduce this error when you execute FOR JSON clause directly in SQL server? One common error is that database column where you store data is defined as VARCHAR instead of NVARCHAR and this might mess some international characters if wrong collation is set on the VARCHAR column.
FOR JSON returns data in NVARCHAR format that is equivalent to UTF-18. SQL server generally cannot work with UTF-8, but NVARCHAR should show any data.
If your client app expects UTF-8 could you change encoding there to UTF-16? In ASP.NET controllers you can set content type using something like:
I would like to know if there is some bug in Belgrade Sql client, but I have used it even in one project where I have displayed Japanese characters in client side with JSON generated using Belgrade SQL Client (sample project is on GitHub[^] ). Inthis project I have server JSON response generated with Belgrade Client to JQuery Datatables component and it worked well, so I'm interested what kind of error you see.
ARTICLE TITLE: Building REST services with ASP.NET Core Web API and Azure SQL Database
"Net Core is still under development and we might have some breaking change before RTM, so here I'm using .Net Framework. However, the core principles apply both on ASP.NET Core applications created using .Net Framework and .Net Core."
That is very funny!!!!!! What EXACTLY does Core provide that a million applications have not already got ???
I'm not an expert for ASP.NET Core, but i believe that it is rewrite of existing framework that will enable faster and more portable apps.
Since it will be more lightweight, I assume that it would run faster since it will not have unnecessary components.
You can run you apps on Linux servers if you need lower price of licences (.Net core on Linux will be free as any other OSS framework). With new SQL Server on Linux, this stack might reduce your cost if you already have Linux environment and you don't want additional Windows servers just to host ASP.NET and SQL Server.
But, maybe it would be better to post this question somewhere (CodeProject forum, stack overflow) where some expert for .Net Core would give you better answer.