简体   繁体   中英

Entity Framework, Bound Context and DDD

I am trying to create bounded context using EF and a edmx file. At the beginning all entities are in the same edmx file and then I split the model in another project and I change the Dbset and I use IDbSets instead. I created other edmx file and I am trying to use a table/tables that are in the other edmx. Of course when I run the custom tool (right click on the edmx file, run custom tool) the tt file removes the table/Idbset from one place to another. What do you guys do? How about if you need a context with few tables and you do not want some tables that are related to the one that you add to that context. Hopefully someone understand my question?

Can you create multiple edmx(s) with only the tables you need? For example ABC.edmx have three tables A, B & C. The three entities that you generate through T4 belong to a bounded context ABC. You can create another DEF.edmx having the tables D,E & F. The entities D,E & F belong to the bounded context DEF.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM