entity framework - Spliting Multiple DbContexts -


I have read and saw some projects that talk about spliting or multiple DBCTNext and I'm not sure that the most What is a good practice, should I make every DBCTCact for every unit or should I have all the institutions in a DBCT?

What is it for me now?

  Public Sector individual currency: DBCTNtex {public demographics (): base ("name = employee context") {} public DbSet & lt; Person & gt; People {receive; Set; }} Public Class OrderContacts: DBCCentx {Public Order-Consort (): Base ("name = employee contact") {} Public DBSet & lt; Order & gt; People {receive; Set; Actually you do not need to create a DBConttex for each unit. But you can have multiple DBC presentations for a single database For an example, we say that you want to separate your business aspect and security aspect into two different modules. Then surely you can have two different references such as securitycontacts, which are all related to security and business related organizations, including trade related institutions, formerly:  
  public class securityContax: DBCTTEX { Public demographics (): Base ("name = securitycontext") {} Public DBSet & lt; Users & gt; User {Received; Set; } Public DBSet & lt; Role & gt; Role (get; set;) Public DbSet & lt; Group & gt; Group {Receive; Set;}} Public Class Business Contact: DBCTNtex {Public OrderExec (): Base ("name = business content") {} public DBSet & lt; Order & gt; Order {Receive; Set;} Public DbSet & lt; OrderLine & gt; Orderline {Receive; Set;} Public DbSet & lt; Customer & gt; Customer {Receive; Set;} }  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -