You are implementing a WCF Data Service client application. You generate WCF Data Service client library classes, including a class that extends DataServiceContext named NorthwindEntities. NorthwindEntities includes a property named Orders that gives Order entities. You need to retrieve the Order entity with OrderID 7.

Which code segment should you use?

 Posted by Rajkatie on 9/4/2012 | Category: ADO.NET Interview questions | Views: 2467 | Points: 40
Select from following answers:
  1. NorthwindEntities context = new NorthwindEntities(new Uri("http://localhost:12345/Northwind.svc")); Order order = context.Orders.SingleOrDefault(o => o.OrderID == 7)
  2. NorthwindEntities context = new NorthwindEntities(new Uri("http://localhost:12345/Northwind.svc ")); var query context.Orders.AddQueryOption("OrderID", 7);
  3. NorthwindEntities context = new NorthwindEntities( new Uri("http://localhost:12345/Northwind.svc/Orders")); Order order = context.Orders.AddQueryOption("OrderID", 7).FirstOrDefault();
  4. All Above

Show Correct Answer

Source: MeasureUp.Com | | Alert Moderator 

Comments or Responses

Login to post response