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.