EF4 - Get Child Value
i'm beginning with EF4,
In my Controller class, i have an object like this
House
->List<Wall>
->List<Windows>
Because i want to be able to cancel change, i keep this data in a object
(i use SaveChange to "commit" data)
I would like to have a function like that :'Windows getWindowsById(Guid IdWindows)
'
Is their any better way to get my windows without iterating with "wall" and "windows" (fore开发者_如何学JAVAach ...
) ?
I use CTP5 so maybe a query with the Local
propertie can be a way, but i would like to know the best way
thanks
If you are using CTP5 I expect that this should work:
context.Windows.Local.SingleOrDefault(w => w.Id == idWindow);
精彩评论