Sample query:
Orders.Average (o => o.OrderNumber)
If OrderNumber is of type int or long, the Average query operator method should return a double value (as the average value might not be a cardinal number). However, re-linq simply generates the following SQL:
SELECT AVG([t0].[OrderNo]) FROM [Order] [t0]
This is wrong because SQL's AVG returns an integer if the expression passed to it is of integer type.
This should be changed to emit the following SQL:
SELECT AVG(CONVERT (REAL, [t0].[OrderNo])) FROM [Order] [t0]