I have two table A,B , their relationship is 1 to 1, i have a method to get the info of A,
and there is a property B in the entity A, but after i user the method detach(A), found
the property B of entity A is null, i just want to return a detached entity to client side.
could you help me how to get a detached entity A contains property B?
Code snip
var a = Context.A.Include('B').Where(i.id=1) //the property B of entity a is not null
Context.Detach(a) ;// after executing this method the property B of entity a is null
According to Daniel Simmons @ http://social.msdn.microsoft.com/Forums/pl/adodotnetentityframework/thread/6c0aa93e-7fdf-475c-86ea-d5caac918329:
Alternatively, have a look at this answer which might help you, or alternatively that one.