zzzprojects / GraphDiff

GraphDiff is a library that allows the automatic update of a detached graph using Entity Framework code first.
https://entityframework-graphdiff.net/overview
MIT License
333 stars 102 forks source link

Updating Nested Collections is not working #124

Closed racksen closed 9 years ago

racksen commented 9 years ago

Hi, I just tried to update the following nested collections but it works only up to Level#2. Could you please shed some light on adding the map up to Level#3.

Request Has Many Scenarios - Level#1 Scenario Has Many Schedules - Level#2 Schedule Has Many Routes - Level#3

Here is the code i used in my update command RequestBE entityUpdate = entity as RequestBE; _context.UpdateGraph(entityUpdate, map => map.OwnedCollection(s => s.SCENARIOS, with => with.OwnedCollection(o => o.SCHEDULES)));

josh-dastmalchi commented 9 years ago

Looks like you need to add the level 3 entities update statement - either an associated or owned collection of routes.

with.OwnedCollection(o=>o.SCHEDULES, alsoWith=> alsoWith.OwnedCollection(s=>s.ROUTES)