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?

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();
La correcta es la D? porque la A no es correcta. Pienso que no hay información suficiente para decidir entre una o otra.
0
0
I agree; it’s not clear. But perhaps there’s a clue in that both B & C mention Color, not Colors.
0
0
The Database table will be called “Color” and the method generated to get the list of entries will be ‘pluralized’ to “Colors”
0
0
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
http://blogs.msdn.com/b/adonet/archive/2011/01/31/using-dbcontext-in-ef-feature-ctp5-part-6-loading-related-entities.aspx
0
0