PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application
that uses the ADO.NET Entity Framework to model entities. You create an entity model as shown in
the following diagram.

You need to ensure that all Person entities and their associated EmailAddresses are loaded. Which
code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
var people = context.People.Include
(“EmailAddresses”).ToList();

B.
var people = context.People.Except
(new ObjectQuery<Person>(“Person.EmailAddresses”, context)).ToList();

C.
var people = context.People.Except
(new OtajectQuery<Person>(“EmailAddresses”, context)).ToList();

D.
var people = context.People.Include
(“Person.EmailAddresses”).ToList();

Explanation:
CHAPTER 6 ADO.NET Entity Framework
Lesson 1: What Is the ADO.NET Entity Framework?
Lazy Loading vs. Explicit Loading vs. Eager Loading (page 384)
http://msdn.microsoft.com/en-us/library/bb896272.aspx


Leave a Reply