nerdexam
Microsoft

70-573 · Question #102

You create a Microsoft .NET Framework console application that uses a Representational State Transfer (REST) API to query a custom list named Products. The application contains the following code…

The correct answer is A. code.Products.ToList. MNEMONIC RULE: "read all items ToList" Interacting with SharePoint 2010 lists using REST, ASP.NET and ADO.NET Data Services Enumerable.ToList<TSource> Method

Developing for Data Access

Question

You create a Microsoft .NET Framework console application that uses a Representational State Transfer (REST) API to query a custom list named Products. The application contains the following code segment. AdventureWorksDataContext codc = new AdventureWorksDataContext(new codc.Credentials = CredentialCache.DefaultCredentials; You need to read all items in Products into an object. Which method should you use?

Options

  • Acode.Products.ToList
  • Bcode.Products.All
  • Ccode.Products.AsQueryable
  • Dcode.Products.ElementAt

How the community answered

(18 responses)
  • A
    83% (15)
  • B
    11% (2)
  • D
    6% (1)

Explanation

MNEMONIC RULE: "read all items ToList" Interacting with SharePoint 2010 lists using REST, ASP.NET and ADO.NET Data Services Enumerable.ToList<TSource> Method

Topics

#REST API#ListData.svc#LINQ to SharePoint#data context

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice