using System.Data.Entity;
using Z.EntityFramework.Classic;
public static void Main()
using (var context = new EntityContext())
Console.WriteLine("QueryResultFilterManager.IsEnabled: " + context.Configuration.QueryResultFilter.IsEnabled);
public class EntityContext : DbContext
public EntityContext() : base(FiddleHelper.GetConnectionStringSqlServer())
this.Configuration.QueryResultFilter.Filter<ISoftDelete>(customer => !customer.IsDeleted || this.DisplaySoftDelete());
public bool DisplaySoftDelete()
public DbSet<Customer> Customers { get; set; }
public interface ISoftDelete
bool IsDeleted { get; set; }
public class Customer : ISoftDelete
public int CustomerID { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public bool IsDeleted { get; set; }