Include() not working

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
haiduc32
Posts: 5
Joined: Mon 27 Jun 2011 09:44

Include() not working

Post by haiduc32 » Thu 01 Sep 2011 09:21

Hi,
we started using dbMonitor lately and I've spotted that the Include() has no action. For example:

Code: Select all

Customer customer = context.Customers.Include("Orders").Single( ... );
Order order = customer.Orders.First();
will generate 2 selects in db instead of expected only one.

Is this a known issue, some flag we have to set?

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 02 Sep 2011 13:54

haiduc32 wrote:generate 2 selects in db instead of expected only one.
Do you mean the "Prepare: Select..." and "Execute: Select..." records in dbMonitor? These are two stages of a single select.

haiduc32
Posts: 5
Joined: Mon 27 Jun 2011 09:44

Post by haiduc32 » Fri 02 Sep 2011 14:03

hi,
to be more specific:

Code: Select all

Customer customer = context.Customers.Include("Orders").Single( ... ); 
//one select is done here on the Customers table
Order order = customer.Orders.First();
//one select is done here on the Orders table

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 05 Sep 2011 13:03

Could you please send us a small test project with the corresponding DDL/DML script to reproduce the issue in our environment?

Post Reply