The following SQL
SELECT * FROM customers
converted to this in LINQ
var customers = from c in customers select c;
Is their any good reasones why the from and select is swaped?
The only logical reason I can think of is for intellisens? For the intellesens to get resolved, it needs to know what it is querying (scope)?
Any other reasons why it was swaped?
Select is swapped because it represents the order of the method calls that the LINQ query syntax is representing.
This is equivalent to
or
SQL gets away with it, by processing the entire statement before proceeding, but in order to get things like intellisense and to figure out if your select is valid it has to be the last step and not the first.
You might also want to look at FLWOR, which is a closer representation, which stands for for, let, where, orderby, and return. You’ll note the for, which is equivalent to from, is first; and the return, which is equivalent to select, is last.
SQL, here, is more the abnormality. How is one supposed to know what you’re operating on before you’ve specified your domain.