Page 1 of 1

Error when using multiple .Include()

Posted: Fri 04 Apr 2014 08:45
by avalor
I'm using dotConnect for Oracle 8.3.125 and EF6.1 and I'm getting an error when trying to run this query:

Code: Select all

var res = db.PROPIEDADVALOR
    .Include(x => x.COORDENADA)
    .Include(x => x.PROPIEDAD.COMPOSICION)
    .Include(x => x.PROPIEDADVALORCOMPOSICION)
    .Include(x => x.USUARIO)
    .Where(x => x.PROPIEDADID == id &&
       x.COORDENADA.Any(c => c.FECHAHORAPDA >= fecha && c.FECHAHORAPDA < DbFunctions.AddDays(fecha, 1).Value && c.LATITUD != 0 && c.LONGITUD != 0));
The error says: 'System.Data.Entity.Core.EntityCommandCompilationException - An error occurred while preparing the command definition. See the inner exception for details.
System.NotSupportedException - Casting to 'r' is not supported.'

If I comment the first or the second .Include(), it works well, also if I comment two of the Includes.

Re: Error when using multiple .Include()

Posted: Fri 04 Apr 2014 11:48
by Shalex
Could you please send us a small test project with the corresponding DDL/DML script for reproducing the issue in our environment?

Re: Error when using multiple .Include()

Posted: Fri 04 Apr 2014 16:34
by avalor
OK. I'll try to reproduce it on next monday

Re: Error when using multiple .Include()

Posted: Mon 07 Apr 2014 07:54
by avalor
Hi!
I've just sent you a small test project reproducing the issue.

Re: Error when using multiple .Include()

Posted: Mon 07 Apr 2014 13:27
by Shalex
Thank you for the test project. We are investigating the issue.

Re: Error when using multiple .Include()

Posted: Wed 09 Apr 2014 14:17
by Shalex
The bug with using multiple .Include() with spatial columns is fixed. We will notify you when the corresponding build of dotConnect for Oracle is available for download.

Re: Error when using multiple .Include()

Posted: Thu 10 Apr 2014 13:37
by Shalex
New build of dotConnect for Oracle 8.3.135 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=29348.

Re: Error when using multiple .Include()

Posted: Tue 15 Apr 2014 10:03
by avalor
I can confirm that the fix works perfectly.

Thank you so much