I found a problem in 1 to 1 association.
Let me explain.
First I've created two tables (CUSTOMER,EXTCUSTOMER)
The EXTCUSTOMER is a table managed by an external application.
I can't alter its structure.
The create sql script can be found here :http://recette.pilotesage.com/devart/create.sql
Then I've created a console project with a Devart Entity Model that contain the 2 tables and the 1 to 1 association ( not 0..1 but 1)
Then I've created a Linq query in order to retrieve the data.
In order to optimize the sql statement I wrote the following statement :
Code: Select all
IQueryable cust = context.Customers.Include("SonExtcustomer")
I really want to include SonExtcustomer in order to have only one sql query.
But the generated query is not optimized at all.
Code: Select all
SELECT
1 AS C1,
"Extent1".ID AS ID,
"Extent1".LIBELLE AS LIBELLE,
"Extent3".ID AS ID1,
"Extent3".NOM AS NOM
FROM TESTGIS1.CUSTOMER "Extent1"
LEFT OUTER JOIN TESTGIS1.EXTCUSTOMER "Extent2" ON "Extent1".ID = "Extent2".ID
LEFT OUTER JOIN TESTGIS1.EXTCUSTOMER "Extent3" ON "Extent2".ID = "Extent3".ID
The complete project can be found here : http://recette.pilotesage.com/devart/TestDevart.zip
Regards