This is my POCO entities scenario:
Manufacturer
(1) has Cars
(*)
One Car
entity has a navigation property to a Manufacturer
entity.
One Manufacturer
entity has a navigation property to a Cars collection
I need to query all Cars
of a specified color, with their respective Manufacturer
, so my EF query would be:
Context.Cars.Where(i=>i.Color=='White').Include("Manufacturer").ToList();
This is what I get:
A list of Cars
, with the Manufacturer
correctly populated
The problem is that the Manufacturer
entity brings it navigation property Cars
populated as well:
Cars.FirstOrDefault().Manutefacturer.Cars
is full of cars....
How can I get rid of this undesirable behavior?
Thanks a lot.
UPDATE #1: I do have the following properties set:
this.Configuration.LazyLoadingEnabled = false;
this.Configuration.ProxyCreationEnabled = false;