Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UpdateFromQueryAsync with DbCommandInterceptor #587

Open
doron-legit opened this issue Jun 3, 2024 · 2 comments
Open

UpdateFromQueryAsync with DbCommandInterceptor #587

doron-legit opened this issue Jun 3, 2024 · 2 comments
Assignees

Comments

@doron-legit
Copy link

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

  • EF version: [EF Core v8.0.3]
  • EF Extensions version: [EFE Core v8.101.2.1]
  • Database Server version: [PostgreSQL 15.3]
  • Database Provider version (NuGet): [Npgsql.EntityFrameworkCore.PostgreSQL 8.0.0]
@JonathanMagnan JonathanMagnan self-assigned this Jun 3, 2024
@JonathanMagnan
Copy link
Member

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants