070-516 試験問題を無料オンラインアクセス
試験コード: | 070-516 |
試験名称: | TS: Accessing Data with Microsoft .NET Framework 4 |
認定資格: | Microsoft |
無料問題数: | 196 |
更新日: | 2025-09-03 |
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 two
ObjectContext instances named context1 and context2.
You need to persist the changes in both object contexts within a single transaction. Which code segment
should you use?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application uses the ADO.NET Entity Framework to manage customer and related order records.
You add a new order for an existing customer. You need to associate the Order entity with the Customer
entity.
What should you do?
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?
The Entity Data Model file (.edmx file) must be updated to support inheritance mapping for Products and Componets.
You need to add the following code to the \Model\Model.edmx file:
-the code in line EX243 that maps the Product type
-the code in line EX250 that maps the Component type
What should you do?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that
uses the Entity Framework.
Entity types in the model are generated by the Entity Data Model generator tool (EdmGen.exe).
You write the following code. (Line numbers are included for reference only.)
01 MemoryStream stream = new MemoryStream();
02 var query = context.Contacts.Include("SalesOrderHeaders.SalesOrderDetails");
03 var contact = query.Where("it.LastName = @lastname", new ObjectParameter
("lastname", lastName)).First();
04 ....
You need to serialize the contact and all of its related objects to the MemoryStream so that the contact can
be deserialized back into the model.
Which code segment should you insert at line 04?