Entity Framework 4.1.Code First. Automatically populating entities by ID
-
25-10-2019 - |
Question
I have a complex object graph which is just a set of stubs ie POCO types with an Id, which are freshly created and not attached to the context. These match up (by Id) with items already in the database. I am expecting EF to offer a means of 'hydrating' all of these stubs recursively... what's the mantra?
Solution
As long as the properties are virtual
this works as expected.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow