EntityFramework-Extensions icon indicating copy to clipboard operation
EntityFramework-Extensions copied to clipboard

Support Microsoft.Data.SqlClient for BatchSaveChanges

Open GebitMattias opened this issue 1 year ago • 2 comments

Description

EF6 got an official update to version 6.5 and with this suggests using the Microsoft.Data.SqlClient provider:

  • https://github.com/dotnet/ef6/releases/tag/v6.5.0
  • https://learn.microsoft.com/en-us/ef/ef6/what-is-new/microsoft-ef6-sqlserver

However the BatchSaveChanges() methods do not support this provider as discussed here #467. It returns this exception: Oops! The provider 'Microsoft.Data.SqlClient.SqlConnection' is not supported for 'BatchSaveChanges'. Uses 'BulkSaveChanges' instead.

We cannot change our code to BulkSaveChanges as suggested. Are there plans to update BatchSaveChanges to support Microsoft.Data.SqlClient?

GebitMattias avatar Jun 17 '24 11:06 GebitMattias

Hello @GebitMattias ,

Yes, there is some plan to support Microsoft.Data.SqlClient, but probably more at the end of next Month.

All the code needed to be compatible with Microsoft.Data.SqlClient is already coded at around 95% (We already support it for Dapper Plus and EF Core), so we are just waiting for an official stable version to get released.

The current v6.5 that was released on June 14 contains a critical bug, as shown on NuGet, so we are currently waiting for an official stable version before making it happen.

As said, I believe the support will be added at the end of August (if a stable version is release since this date)

Best Regards,

Jon

JonathanMagnan avatar Jun 17 '24 13:06 JonathanMagnan

Thanks for the quick reply. We were just testing out switching to Microsoft.Data.SqlClient and ran into the issue with EF Extensions before the EF package ones ;) Looking forward to the update!

GebitMattias avatar Jun 17 '24 13:06 GebitMattias

Hello @GebitMattias ,

The v8.103.2.0 has been finally released.

The support for Microsoft.Data.SqlClient for BatchSaveChanges should finally work.

Could you test it and let us know if everything is working as expected?

Best Regards,

Jon

JonathanMagnan avatar Aug 13 '24 16:08 JonathanMagnan

Hi @JonathanMagnan, thanks for the heads-up, but we are currently planning to skip the EF 6.5 upgrade and instead look into going straight to EF 7 or 8. I will let you know, if we do the EF6.5 instead. You can close this issue

GebitMattias avatar Aug 22 '24 07:08 GebitMattias