Skip to content

Instantly share code, notes, and snippets.

@ro31337
Created August 20, 2014 21:00
Show Gist options
  • Save ro31337/879717d3daac46393c89 to your computer and use it in GitHub Desktop.
Save ro31337/879717d3daac46393c89 to your computer and use it in GitHub Desktop.
public class MyContext : DbContext
{
public virtual IDbSet<Company> Companies { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Company>()
.Map(m => m.Requires("IsDeleted").HasValue(false))
.Ignore(m => m.IsDeleted);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment