https://github.com/devd4v3/efcore.customquerypreprocessor
A custom query expression preprocessor that plugs into the LINQ query processing pipeline of EF Core
https://github.com/devd4v3/efcore.customquerypreprocessor
Last synced: 5 months ago
JSON representation
A custom query expression preprocessor that plugs into the LINQ query processing pipeline of EF Core
- Host: GitHub
- URL: https://github.com/devd4v3/efcore.customquerypreprocessor
- Owner: DevD4v3
- Created: 2022-08-09T03:35:26.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T01:05:13.000Z (over 3 years ago)
- Last Synced: 2025-10-10T03:32:12.053Z (9 months ago)
- Language: C#
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EFCore.CustomQueryPreprocessor
[](https://www.nuget.org/packages/EFCore.CustomQueryPreprocessor/)
I am not the creator of the code for this repository. The only thing I did was to wrap Ivan Stoev code in a class library for reuse in other projects.
All credits to Ivan Stoev.
Read Ivan Stoev original answer: https://stackoverflow.com/a/62138200
## Installation
Run the following command in the terminal if your project is using EF Core 3.1/5.0:
```bash
dotnet add package EFCore.CustomQueryPreprocessor -v 1.0.0
```
In case your project uses EF Core 6.0/7.0, run the following:
```cs
dotnet add package EFCore.CustomQueryPreprocessor -v 2.0.0
```
## Usage
Call the following method in `DbContext.OnConfiguring`:
```cs
public class AppDbContext : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.AddDelegateDecompiler();
}
}
```
And don't forget to add the `[Decompile]` decorator on the methods you want to decompile.