Disconnected Behavior of Entity Framework when Updating Object Graph

前端 未结 3 2005
臣服心动
臣服心动 2021-01-21 14:54

I\'m currently working with a project that use following technologies.

  1. ASP.net MVC - presentation Layer
  2. Data Service Layer - (WCF)
  3. Data Transfer
3条回答
  •  梦毁少年i
    2021-01-21 15:37

    Is your issue now that you use EF and it makes lots of calls for updates? I don't see a way around that here as your phone numbers and emails are separate tables. You could create a flattened entity for the user that contains ex five of each and map to a proc for your insert. It would reduce calls but not the cleanest IMHO. If you are processing many users at once then maybe breakup the UOW to act per user only so you have shorter transactions. Is there currently a performance issue or just a future concern? –

    Without flattening you are in no different of a scenario than without using EF. I don't understand why thought because you are using DDD you can't introduce entities specific to data mappings.Your Entities can still be used, you just in addition have a new entity with mappings. In fact you can do this without entities in your repository later (repository queries changed objects, flattens and sends to data access layer to call proc)

提交回复
热议问题