using System.Data.Entity;
public static void Main()
using (var context = new EntityContext())
var filter = context.Configuration.QueryResultFilter.Filter<ISoftDelete>("id_001", customer => !customer.IsDeleted || context.DisplaySoftDelete());
Console.WriteLine("2 - Gets the `QueryFilter` ID : " + filter.ID);
public class EntityContext : DbContext
public EntityContext() : base(FiddleHelper.GetConnectionStringSqlServer())
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; }