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

前端 未结 5 505
陌清茗
陌清茗 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 06:01

    Late question on this topic. Reading Josh Kodroff's answer confirms my thoughts about the implementation of a Repository to, for instance, Entity Framework DAL.

    You map the domain object to an EF persistance object and let EF handle it when saving. When retrieving, you let EF fetch from database and map it to your domain object(aggregate root) and adds it to your collection.

    Is this the correct strategy for repository implementation?

提交回复
热议问题