Microsoft released version 3 of the Microsoft.Data.SqlClient. This .NET Data Provider for SQL Server provides general connectivity to the database and supports all the latest SQL Server features for applications targeting .NET Framework, .NET Core, and .NET Standard. It can be used as a replacement for the built-in System.Data.SqlClient that will still be available for a long time but doesn’t support newer SQL Server features.
I thought the 3.0 release was a good reason to make the switch in my .NET Core applications. As I’m using NHibernate (together with FluentNHibernate) I had to do some configuration work to get this working.
Remark: If you are using EF Core, there is nothing you need to do if you are using version 3.0 or higher. From that version on the Microsoft SQL Server EF Core provider uses Microsoft.Data.SqlClient by default.
The steps to get it working with (Fluent)NHibernate are short and easy:
- Step 1 - Add a reference to Microsoft.Data.SqlClient
- Step 2 - Update your FluentNHibernate configuration:
That's all!