Has anyone written a ASP.NET Core Web API targeting SQL Anywhere? I suspect this is problematic because the ConfigureServices method in the Startup class needs to set up a DbContext, which is an Entity Framework Core object, and SQL Anywhere does not have an Entity Framework Core provider. I don't see a generic ODBC EF Core provider. Does anyone have success using System.Data.Odbc instead of Entity Framework Core in an ASP.NET Core Web API? I would really enjoy seeing a "Startup.cs" file from such a .NET project. Any guidance on how to proceed would be appreciated. asked 08 Dec '20, 13:31 dharrel |
For .Net Core you can not use Entity Framework at all with SQL Anywhere. You can only use a plain ODBC connection. answered 09 Dec '20, 07:59 beater Thanks. I'd really like to see an example of what you would encode for "services.AddDataContext..." when using a plain ODBC connection.
(09 Dec '20, 16:11)
dharrel
there is none. you can't do that at all. That is an Entity Framework concept.
(10 Dec '20, 05:52)
beater
Thanks, again. Can you suggest an alternative with "plain ODBC"? Is it at all possible to create a ASP.NET Core Web API that uses "plain ODBC" to work with a SQL Anywhere database? I know we can do this using Appeon frameworks, and we are doing so, but I'm interested to know whether there is a "pure Microsoft" approach.
(10 Dec '20, 13:17)
dharrel
the same way you would have done anything with SQL Anywhere and C# before Entity Framework came along.
(11 Dec '20, 07:48)
beater
Very good. Thanks. I'm new to this technology, so I haven't done this before EF came along. However I'll cross that bridge if I get to it.
(11 Dec '20, 14:45)
dharrel
|