Error when using multiple .Include()
Posted: Fri 04 Apr 2014 08:45
I'm using dotConnect for Oracle 8.3.125 and EF6.1 and I'm getting an error when trying to run this query:
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.
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));
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.