Examveda

Assume 2 columns named as Product and Category how can be both sorted out based on first by category and then by product name?

A. var sortedProds = _db.Products.Orderby(c => c.Category)

B. var sortedProds = _db.Products.Orderby(c => c.Category) + ThenBy(n => n.Name)

C. var sortedProds = _db.Products.Orderby(c => c.Category) . ThenBy(n => n.Name)

D. all of the mentioned

Answer: Option C


Join The Discussion

Related Questions on LINQ (Language Integrated Query) in C Sharp