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
Post a Comment