Closed JendaPerl closed 6 months ago
Hello @JendaPerl ,
Thank you for this suggestion. While I agree it will be nice, that will currently require way too much modification to make it work correctly. So that's currently impossible for us due to the time involved to make it happen.
Best Regards,
Jon
Sponsorship Help us improve this library
Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework Extensions • Dapper Plus
Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval Function
It's OK. I can find a workaround :-) I just got scared at first, because I had several IncludeOptimizedByPath() calls on that query at first and the interceptor got called ten times.
If you do some refactoring in those parts later, please consider either sending all the queries to the server in a single batch or give interceptors some way to tie the queries together, but it's definitely not a pressing issue.
If I have a query like this: db.Articles.FirstOrDefault(...) my interceptor only gets called once.
If the query is like this db.Articles.IncludeOptimizedByPath("Something").FirstOrDefault(...) it gets called four times.
While I do understand such LINQ queries send several snippets of SQL to the server, it would be nice to be able to tell they are all part of the same LINQ query. Perhaps you might add some information to the DbCommandInterceptionContext to link those related queries. Or keep the UserState between them