Compiler Error CS1939
A range variable is a read-only variable that is introduced in a query expression and serves as an identifier for each successive element in a source sequence. Because it cannot be modified in any way, there is no point in passing it by ref or out. Therefore, both operations are not valid.
To correct this error
Pass the range variable by value.