DelegateDecompiler icon indicating copy to clipboard operation
DelegateDecompiler copied to clipboard

Automatically decompile using a IDbContextOptionsExtension like LinqKit does?

Open bzbetty opened this issue 4 years ago • 3 comments

Linqkit lets you register an EF extension so that they don't need the manual Decompile() like call for each query. I think something like that would be theoretically possible with Delegate Decompiler too?

builder
    .UseSqlServer(connectionString)
    .WithExpressionExpanding();

reference: https://github.com/scottksmith95/LINQKit/blob/master/src/LinqKit.Microsoft.EntityFrameworkCore/ExpandableDbContextOptionsExtension.cs

bzbetty avatar Sep 09 '22 10:09 bzbetty

Thanks for suggestion. I'll think about this. Meanwhile. Pull requests are welcomed.

hazzik avatar Oct 17 '22 04:10 hazzik

I've done some preliminary work. Unfortunately a new package for EF Core 6 would be required as there are some incompatible changes that I cannot make compatible between both EF Core 5 and EF Core 6.

hazzik avatar Oct 26 '22 03:10 hazzik

@hazzik You can take a look at this SO answer https://stackoverflow.com/a/62138200/5202563, and especially the update for EF Core 7.0, since now thanks to the added Linq query expression interception mechanism all you need is few lines of code.

powermetal63 avatar Dec 11 '22 06:12 powermetal63