Your application includes a class named Product. Product includes properties named ProductName and CategoryID. A class named Category contains properties named CategoryName and CategoryID. You need to use LINQ to query a list of Product instances named products and a list of Category instances named categories for the names of all products belonging to the category with CategoryName "Beverage".

Which query should you use?

 Posted by Rajkatie on 8/31/2012 | Category: ADO.NET Interview questions | Views: 2282 | Points: 40
Select from following answers:
  1. var q = from c in categories join p in products on c.CategoryID equals p.CategoryID where c.CategoryName == "Beverage" select p.ProductName;
  2. var q = from c in categories join p in products on c.CategoryID equals p.CategoryID select p.ProductName == "Beverage";
  3. var q = from c in categories join p in products on c.CategoryID equals p.CategoryID select c.CategoryName == "Beverage";
  4. All Above

Show Correct Answer


Source: MeasureUp.Com | | Alert Moderator 

Comments or Responses

Login to post response