I'm having an issue with Entity Framework where if I include an entity, for instance I have:
Entity A that has a foreign key reference to:
Entity B
If I run an Entity Framework query and do a .Include("Entity B") my result entity (Entity A) has a property of .Entity B. Ok that's good that's what I expect. BUT!
Entity B then has an Entity A property that is populated which then has an Entity B property that is populated which then has an Entity A property that is populated and it goes on and on and on.
Why is Entity Framework doing this? It seems wasteful and the size of the entity being returned is so much larger due to all the unnecessary materialization of these entities.
Surely I'm missing some setting somewhere. Any ideas guys?