PrepAway - Latest Free Exam Questions & Answers

What should you do?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
You use the ADO.NET Entity Data Model (EDM) to define a Customer entity.
You need to add a new Customer to the data store without setting all the customer’s properties. What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Call the Create method of the Customer object.

B.
Call the CreateObject method of the Customer object.

C.
Override the Create method for the Customer object.

D.
Override the SaveChanges method for the Customer object.

Explanation:
CreateObject<T> Creates and returns an instance of the requested type .

2 Comments on “What should you do?

  1. John Galt says:

    Agreed.
    A should read:
    Customer customer = Customer.CreateCustomer(“id”, “name”, “address”);

    B should read:
    Customer customer = context.CreateObject();

    Another shitty question from Microsoft. Still, the answer is B, because A requires you to set all customer’s properties, which the question tells you not to do.




    0



    0

Leave a Reply