c# - How exclude an entity and its properties in Entity Framework Migrations? -


consider have model:

// in accounting.dll public class invoice {     public int number{ get; set; }     public company { get; set; } }  public accountingdbcontext : dbcontext {     // ...      public dbset<invoice> invoices { get; set; } } 

in model i've used company defined in project

// in infrastructure.dll public class company {     public string name{ get; set; }  }  public infrastructuredbcontext : dbcontext {     // ...      public dbset<company> companies { get; set; } } 

the company being created via infrastructure migrations. in accounting project, finds company new create table for.

question: how can set migrations in accounting leave company alone while scaffolding migrations?

i've tried modelbuilder.entity<company>.ignore(). it's not solution whole entity framework ignores it. want migrations ignore it.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -