EntityFramework-Plus
EntityFramework-Plus copied to clipboard
Getting the SQL statement for an Update, Insert, or Delete query
When using "normal" EF 6 LINQ queries, one can obtain the SELECT SQL for them by either calling ToString()
(without parameter values) or by getting the underlying object query (with parameter values).
Is something similar possible with EF-Plus's Update
, Insert
, or Delete
queries? I.e., not executing them immediately, but getting the actual DB command including parameters?
I'd like to collect a number of individual queries and batch them together into a single DB roundtrip. Getting the command without executing it would be a simple way to solve this.
Hello @fschmied ,
This features will be eventually implemented since we understand the value here. But at this moment, we, unfortunately, don't have the time for such thing ;(
Best Regards,
Jonathan
Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework Extensions • Entity Framework Classic • Bulk Operations • Dapper Plus
Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval Function • SQL Eval Function
I understand. Would you accept a PR of I created one? I'd simply extract the relevant code from BatchUpdate.Execute
etc. into a public CreateCommand
method.
Sure @fschmied ,
We are always open for some help :)
Okay, great! I'll see to it when we actually build the feature in our application that needs batched update/insert/delete statements.