简体   繁体   中英

Entity Framework Fluent API and MultiBoundedContext

I have applied multi bounded context principle of domain driven design and have 3 different objects (in 3 different domain contexts) pointing to the same table in the database. As julie lerman suggested, i have a shared database model which has all my objects. This shared database model is used for code-first migrations. I also have fluent api configurations that represent foreign key relationships and column constraints on the shared database model. The question is, should i let my 3 domain specific contexts know of these fluent api configurations. I would like to validate my object graph in each of these contexts. Should i just worry about string lengths, required etc etc on these separate domain contexts? Is it necessary/good practice to configure these relationships on each of the 3 separate domain contexts?

是的,您确实必须在较小的域特定模型中重复流利的api配置。

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