nerdexam
Microsoft

70-516 · Question #64

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the ADO.NET Entity Framework Designer to model entities. The application includes…

The correct answer is A. foreach(var email in person1.EMailAddresses){ B. while(person1.EMailAddresses.Count>0){. Working with Self-Tracking Entities Working with Sets of Self-Tracking Entities

Manipulating and Validating Data

Question

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the ADO.NET Entity Framework Designer to model entities. The application includes self-tracking entities as shown in the following diagram. There is a Person entity names person1 that has TrackChanges turned on. You need to delete all e-mail addresses that are associated with person1 by using an ObjectContext. What are two possible code segments that you can use to achieve this goal? (Each correct answer presents a complete solution. Choose two).

Exhibit

70-516 question #64 exhibit

Options

  • Aforeach(var email in person1.EMailAddresses){
  • Bwhile(person1.EMailAddresses.Count>0){
  • Cperson1.EMailAddresses = null;
  • Dperson1.EMailAddresses = new TrackableCollection<EMailAddress>();

How the community answered

(34 responses)
  • A
    71% (24)
  • C
    12% (4)
  • D
    18% (6)

Explanation

Working with Self-Tracking Entities Working with Sets of Self-Tracking Entities

Topics

#self-tracking entities#TrackableCollection#collection manipulation#Entity Framework

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice