EF6 How to get navigation properties when Parent entity in detach state.

Amol M 1 Reputation point

I am using detach for performance, I need solutions to load navigation property when parent entity is in detach state. I read many article looks like not possible just trying my luck if anyone has any idea.

I want to maintain all data after detach.

Thanks in advance

Entity Framework 6.0
Entity Framework 6.0
A Microsoft open-source object-database mapper for .NET.
244 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jack J Jun 23,661 Reputation points Microsoft Vendor

    @Amol M , Welcome to Microsoft Q&A, you could refer to the question restoring navigation property after detaching entities to restore the properties after detaching the entities.


    context.LoadProperty(customer, c => c.Orders, MergeOption.OverwriteChanges);