using System.Data.Entity;
using Z.EntityFramework.Plus;
public static void Main()
AuditManager.DefaultConfiguration.SoftDeleted<Customer>(x => x.IsDeleted);
using (var context = new EntityContext())
var listToRemove = context.Customers.ToList();
listToRemove.ForEach(x => x.IsDeleted = true);
audit.CreatedBy = "ZZZ Projects";
context.SaveChanges(audit);
var entries = audit.Entries;
FiddleHelper.WriteTable("All Entry",entries.Select(x => new{ x.StateName, x.EntitySetName}));
public static void GenerateData()
using (var context = new EntityContext())
context.Customers.Add(new Customer() { Name ="Customer_A", Description = "Description"});
public class EntityContext : DbContext
public EntityContext() : base(FiddleHelper.GetConnectionStringSqlServer())
public DbSet<Customer> Customers { get; set; }
public int CustomerID { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public Boolean IsDeleted { get; set; }