zzzprojects / EntityFramework-Extensions

Entity Framework Bulk Operations | Improve Entity Framework performance with Bulk SaveChanges, Insert, update, delete and merge for SQL Server, SQL Azure, SQL Compact, MySQL and SQLite.
https://entityframework-extensions.net
344 stars 57 forks source link

UpdateFromQueryAsync with DbCommandInterceptor #587

Open doron-legit opened 4 months ago

doron-legit commented 4 months ago

Description

I tried using DbCommandInterceptor (both "Microsoft.EntityFrameworkCore.Diagnostics" and "Z.EntityFramework.Extensions") when calling UpdateFromQueryAsync to get the DbCommand—still, neither works (I override all the possible functions like in this example: https://entityframework-extensions.net/command-interception-in-ef-core). I can get the callbacks from other operations like Select or Count, but not when calling to UpdateFromQueryAsync. What do you think I should do?

Further technical details

JonathanMagnan commented 4 months ago

Hello @doron-legit ,

Unfortunately, our library doesn't use an interceptor at this time.

We tried a few months ago, but it was still too much complicated. It might eventually changes but we don't have any short term plan to make it happens.

However, since EF Core 7, they now support ExecuteUpdate, which is very similar to our UpdateFromQuery. So perhaps looking at the method provided by EF Core itself could solve your issue.

Best Regards,

Jon

doron-legit commented 4 months ago

Okay, I will try to use ExecuteUpdate; I would suggest adding this limitation to the docs. Thank you