ceth
ceth

Reputation: 45285

Is it possible to use SQL Data Provider in NET Core?

I have a project which was written using SQL Data Provider. As I see it depends on System.Data.Linq.

Now I need to port this application to NET Core, but it looks like that NET Core doesn't support System.Data.Linq (https://github.com/dotnet/standard/issues/30).

Is there any way to use SQL Data Provider in NET Core or do I need to rewrite all the database layer ?

Upvotes: 4

Views: 1713

Answers (1)

s952163
s952163

Reputation: 6324

There are other issues besides lacking System.Data with netcore and typeproviders, having to do with reflection. Also, what you are referencing is one of the original F#3 type providers, which is a bit old.

You have some workarounds:

  1. Use Dapper (if you prefer to generate SQL or your queries are dynamic)
  2. Use SqlProvider. if you have access to the DB, and would like type safe access to the schema. I've done this move into this direction on full framework (from Sql Data Provider to SqlProvider).
  3. Use Sql Server directly or with EF Core. I assume this will work OK with SQL Server not sure about other DBs.

There is also Rezoom, which lets you write SQL, but I don't think it supports .netcore (I might be wrong).

Upvotes: 2

Related Questions