PrepAway - Latest Free Exam Questions & Answers

Which code segment should you insert at line 02?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database. You create the classes shown in the following exhibit. You add the following code segment to the application. (Line numbers are included for reference only.)

01 Public Sub QueryPlayers(leagues As List(Of League))
02
03 End Sub

You create a LINQ query to retrieve a collection of Player objects. You need to ensure that the collection includes all the players from each team and every league. Which code segment should you insert at line 02?

PrepAway - Latest Free Exam Questions & Answers

A.
Dim query As var = leagues.[Select](Function(l As ) l.Teams.[Select](Function(t As )Players))

B.
Dim query As var = leagues.[Select](Function(l As ) l.Teams.SelectMany(Function(t As )Players))

C.
Dim query As var = leagues.SelectMany(Function(l As ) l.Teams.SelectMany(Function(t As )Players))

D.
Dim query As var = leagues.SelectMany(Function(l As ) l.Teams.[Select](Function(t As )Players))


Leave a Reply