0

I was thinking to achieve this by using ignore LINQ method.. but didnt have any clue how to achieve it.

public class MyHistoryContext : HistoryContext 
{ 
    public MyHistoryContext(DbConnection dbConnection, string defaultSchema) 
        : base(dbConnection, defaultSchema) 
    { 
    } 

    protected override void OnModelCreating(DbModelBuilder modelBuilder) 
    { 
        base.OnModelCreating(modelBuilder); 
        modelBuilder.Ignore<HistoryRow>();
    } 
} 
kaya3
  • 47,440
  • 4
  • 68
  • 97
Manish
  • 35
  • 2
  • 7

1 Answers1

0

If you don't want the __MigrationsHistory table then don't enable-migrations until you need the database updated. How can I disable migration in Entity Framework 6.0

If you are trying to Ignore tables from the model you can annotate them with NotMapped https://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.notmappedattribute(VS.103).aspx

Community
  • 1
  • 1
Steve Greene
  • 12,029
  • 1
  • 33
  • 54