c# - Understanding a LINQ query - orderby ascending -


i don't understand why code correct , code b incorrect:

code a

ienumerable<decimal> loanquery =  amount in loanamounts amount % 2 == 0 orderby amount  select ascending amount //this line 

code b (incorrect)

ienumerable<decimal> loanquery =  amount in loanamounts amount % 2 == 0 select amount  orderby ascending amount 

as lot of people have answered have been incorrect, have posted correct code:

ienumerable<decimal> loanquery =  amount in loanamounts amount % 2 == 0 orderby amount ascending select amount 

a linq-query not sql-query , has own syntax rules. have follow order:

from            order      select       group 

its same reason why cannot write sql-statement:

select * i=2 tablename 

but have write

select * tablename i=2 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -