Skip to content

Instantly share code, notes, and snippets.

@ion-topala
ion-topala / ModelBuilderExtensions.cs
Created March 29, 2024 14:16 — forked from haacked/ModelBuilderExtensions.cs
Example of applying an EF Core global query filter on all entity types that implement an interface
/*
Copyright Phil Haack
Licensed under the MIT license - https://github.com/haacked/CodeHaacks/blob/main/LICENSE.
*/
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
forwardRef,
Input,
OnChanges,
OnDestroy,
OnInit,
SimpleChanges,