adplus-dvertising
frame-decoration

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?

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

Posted under C# programming

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

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

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

Similar Questions

Discover Related MCQs