How to link System.Data in Visual Studio 2015 with targeting on .NET Core?

I am trying to access the IDbConnection interface in a class library to create a connection object that connects and retrieves data from a database, but I just cannot access the IDbConnection interface, which was supposed to be in System.Data.dll .

I can not find it anywhere in NuGet. So how do I do this?

Has Microsoft changed the way it connects to the database, or has any new interface appeared in .NET Core?

+5
source share
1 answer

Interfaces IDbConnection , IDbCommand , etc. have been removed from the System.Data.Common namespace in .NET Core. They have been replaced by the abstract classes DbConnection , DbCommand , etc. You can read the discussion on this subject here .

You can see the .NET Core progress for System.Data.Common here . In the future, if you are not sure if the types have been moved or deleted, this may be a good place to check.

The NuGet package you want to install is System.Data.Common , which contains the specified types.

+12
source

Source: https://habr.com/ru/post/1232874/


All Articles