Please any one can help me to fix this error?
Schema specified is not valid. Errors:
The mapping of CLR type to EDM type is ambiguous because mult
In some cases this is more of a symptom than the actual problem. For me, it usually pops up when I try to call a function inside a Linq query without calling .ToList() first.
E.g. the error that brought me here was caused because I did this:
var vehicles = DB.Vehicles.Select(x => new QuickSearchResult()
{
BodyText = x.Make + " " + x.Model + "
"
+ "VIN: " + x.VIN + "
"
+ "Reg: " + x.RegistrationNumber +"
"
+ x.AdditionalInfo
type = QuickSearchResultType.Vehicle,//HERE. Can't use an enum in an IQueryable.
UniqueId = x.VehicleID
});
I had to call .ToList(), then iterate through each item and assign the type to it.