lundi 30 novembre 2015

Domain Driven Design with Entity Framework Model First

Regarding persistence of DomainModel using EntityFramework. I would like to validate following approach with experts in this area:

Leverage OnModelCreating to map or ignore navigation properties which are not needed. Unfortunately all these are specific to Code-First.

VS

Treat Model First POCO as DTO & using anti-corruption layer

We have huge investment in database designed using model first, in order to leverage DDD that leaves out only one path for us - leave POCO classes generated by designer alone & Domain classes separate. When ever needed do a manually mapping or use AutoMapper. Am I correct?

Secondly what would be best place to have this mapping, anti-corruption layer?

EDIT: We have > 250 tables in the schema, going through code-first I feel like losing the comprehension ability that designer providers, also model first I have complete authority once .SQL is generated. However in code first I have to live at the mercy of code-first migration to generate / update tables for me.

Aucun commentaire:

Enregistrer un commentaire