简体   繁体   English

实体框架Fluent API和MultiBoundedContext

[英]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. 我已经应用了域驱动设计的多边界上下文原理,并且有3个不同的对象(在3个不同的域上下文中)指向数据库中的同一张表。 As julie lerman suggested, i have a shared database model which has all my objects. 正如julie lerman建议的那样,我有一个共享数据库模型,其中包含了我的所有对象。 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. 我也有流利的api配置,它们表示共享数据库模型上的外键关系和列约束。 The question is, should i let my 3 domain specific contexts know of these fluent api configurations. 问题是,我应该让我的3个特定于域的上下文知道这些流利的api配置。 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? 是否有必要/良好的做法是在3个单独的域上下文中的每一个上配置这些关系?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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