Hi I'm trying to execute the following query but the result has the following error.
Also when I run this with normal entity framework the code executes and results are fine. Is this a bug? If so are there any kind of work around you can suggest?
"Unable to cast object of type 'System.Object[]' to type 'System.Collections.Generic.IEnumerable`1[<>f__AnonymousType0`3[System.Int64,System.String,System.String]]'."
var query = (EntityQuery)(from makes in em.VehicleMakes
orderby makes.MakeName
select new
{
Key = makes.VehicleMakeId,
Name = makes.MakeName,
Description = makes.MakeCode,
Children = from model in makes.VehicleModels
select new
{
Key = model.VehicleModelId,
Name = model.ModelName,
Description = model.ModelCode
}
});
Edited by tersiusk - 09-May-2011 at 6:22am