multiple column selection with aggregate function in LINQ dictionary
I was unable to cope with converting 开发者_JS百科this Sql Query to Linq Expression
SELECT IdVehicle, AVG(Kilometers) FROM [Fuel] GROUP BY IdVehicle, CONVERT(NVARCHAR, Fuel.Time, 102)
Rows are inserted into this table when someone fills fuel into vehicle. Kilometers are read from tachograph. It's possible to fill fuel twice a day so I need average value. Ideally, LINQ result would be Dictionary.
I would really appreciate any suggestion.
For cases like these you might wanna try LinqPad (www.linqpad.net). This great tool lets you test and analyze both SQL statements and Linq expressions.
加载中,请稍侯......
精彩评论