Entity Framework 4.1.Code First. Automatically populating entities by ID
-
25-10-2019 - |
سؤال
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?
المحلول
As long as the properties are virtual
this works as expected.
لا تنتمي إلى StackOverflow