nerdexam
Microsoft

70-516 · Question #161

The database contains orphaned Color records that are no longer connected to Part records. You need to clean up the orphaned records. You have an existing ContosoEntities context object named…

The correct answer is A. var unusedColors = context.Colors. See the full explanation below for the reasoning.

Question

The database contains orphaned Color records that are no longer connected to Part records. You need to clean up the orphaned records. You have an existing ContosoEntities context object named context. Which code segment should you use?

Options

  • Avar unusedColors = context.Colors.
  • Bcontext.Colors.TakeWhile(c => !c.Parts.Any());
  • Ccontext.Colors.ToList().RemoveAll(c => !c.Parts.Any());
  • Dvar unusedColors = context.Colors.Where(c => !c.Parts.Any());

How the community answered

(45 responses)
  • A
    71% (32)
  • B
    4% (2)
  • C
    9% (4)
  • D
    16% (7)

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice