My questions concern this Linq-to-SQL statement:
var r in db.Roles.OrderBy(c => c.RoleName)
1) What is the syntax form called where dots are used in Linq, instead of just typing out a full Linq statement (hopefully this makes sense).
2) I understand what "c => c.RoleName" does, but I do not understand why the syntax is organized like that. I feel that this would make more sense:
var r in db.Roles.OrderBy(r.RoleName)
var r in db.Roles.OrderBy(RoleName)
Why is this needed: "c => c.RoleName"? I don't understand the purpose of pointing c to c.RoleName. This is not as intuitive as the two examples I provided above and at this point I do not have a complete understanding of why the syntax is arranged like it is.
Any assistance with these two questions would be greatly appreciated. Long answers are welcome :)