I am curious what the best practice is for this situation in Entity Framework 4.0. I have the following Entity Map:
Entity A -> Entity B -> Entity C
Where Entity A contains a list of Entity B's which each contains a list of Entity C's. I am using self tracking entities and when I load Entity A I am doing something similar to this:
EntityA entityA = ctx.EntityA.Include("EntityB").Where(x => x.Id == id).SingleOrDefault();
When I attempted to do this:
EntityA entityA = ctx.EntityA.Include("EntityB").Include("EntityC").Where(x => x.Id == id).SingleOrDefault();
It fails because it cannot find the navigation property 'Entity C'. Is there a way to load the navigation properties? I will also need to be able to Track Changes, Accept Changes, and MarkAsDeleted for my various CRUD operations.
As a side-question, is there a common Attribute used to identity a Navigation Property in Entity Framework? I was hoping to use reflection and recursion to identify all of my Navigation Properties.