DDD with EF Code First - how to put them together?

前端 未结 5 507
陌清茗
陌清茗 2021-01-31 05:30

I am learning DDD development for few days, and i start to like it.

I (think i) understand the principle of DDD, where your main focus is on business objects, where you

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-31 05:40

    The Pluralsight course: Entity Framework in the Enterprise goes into this exact scenario of Domain Driven Design incorporated with EF Code First.

    For number 1, I believe you can do it either way. It's just a matter of style. For number 2, the instructor in the video goes through a couple ways to account for this. One way is to have a "State" property on every class that is set on the client-side when modifying a value. The DbContext then knows what changes to persist.

提交回复
热议问题