Delegates on C# related Questions and Answers


Question :   Assume 2 columns named as Product and Category how can be both sorted out based on first by category and then by product name?
1. var sortedProds = _db.Products.Orderby(c => c.Category)
2. var sortedProds = _db.Products.Orderby(c => c.Category) + ThenBy(n => n.Name)
3. var sortedProds = _db.Products.Orderby(c => c.Category) . ThenBy(n => n.Name)
4. all of the mentioned
Answer :   3 - var sortedProds = _db.Products.Orderby(c => c.Category) . ThenBy(n => n.Name)  

* Be the First to Post a Comment.

Submit comment :


Captcha Image
Reload

Ask Question

Captcha Image
Reload

Note : Name and Email never shown.





Subscribe


Become a part of EducationForever. Subscribe to our FREE Newsletter