Entity framework unknown column bug
Posted by: John Korres
Date: September 30, 2012 05:25AM

I have the following linq to entities query which throws an exception:
db.Forecasts
.Where(f => f.GeoNameID == point.ID)
.Where(x => EntityFunctions.AddMinutes(x.DateStamp, utcOffset) >= localTime)
.GroupBy(x => EntityFunctions.AddMinutes(x.DateStamp, utcOffset))
.Select(g => new
{
Date = g.Key,
MinTemperature = g.Select(x => x.Temperature).Min(),
MaxTemperature = g.Select(x => x.Temperature).Max(),
MinWindSpeed = g.Select(x => x.WindSpeed).Min(),
MaxWindSpeed = g.Select(x => x.WindSpeed).Max(),
Conditions = g.Select(x => x.Condition)
});
while the same query without the 'Conditions = g.Select(x => x.Condition)' part works fine.
I read up on the 'Unknown column' issue and found out that it was a known Connector/Net bug in previous versions so I tried this with all the combinations of EF 5 and EF 4.3.1 along with Connector/Net 6.5.4 and the beta Connector/Net 6.6.3. The previous bug pointed to groupby with sum so it is a little different than my issue. Is this a bug or just lack of proper error handling from the connector's part (i.e. this shouldnt work but it should catch it during the generation of the query and not at the database level)?

Options: ReplyQuote


Subject
Written By
Posted
Entity framework unknown column bug
September 30, 2012 05:25AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.