PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

A performance issue exists in the application. The following code segment is causing a performance bottleneck:

var colors = context.Parts.GetColors();

You need to improve application performance by reducing the number of database calls. Which code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
var colors = context.Parts.OfType<Product>().Include(“Colors”).GetColors();

B.
var colors = context.Parts.OfType<Product>().Include(“Product.Color”).GetColors();

C.
var colors = context.Parts.OfType<Product>().Include(“Parts.Color”).GetColors();

D.
var colors = context.Parts.OfType<Product>().Include(“Color”).GetColors();

5 Comments on “Which code segment should you use?

  1. Gaius says:

    The navigation property will be Color, since each product will have only one color mapped to it. This is clear when you see the question in context (part of a case study).




    0



    0

Leave a Reply