Your application includes a collection of Product entities named products. A Product property named Category gives the product category. You need to create a LINQ query to return an object that contains each unique category name along with a list of all products in that category.

Which query should you use?

 Posted by Rajkatie on 8/31/2012 | Category: ADO.NET Interview questions | Views: 2345 | Points: 40
Select from following answers:
  1. from p in products group p by p.Category into g select new { g.Key, g };
  2. from p in from g in products select g.Category select p;
  3. from p in products group p by p.Category into g select g.Key;
  4. All Above

Show Correct Answer


Source: MeasureUp.Com | | Alert Moderator 

Comments or Responses

Login to post response