You need to map a stored procedure to the complex type by using the Entity Designer
You are developing a Microsoft .NET Framework 4 application. You create an Entity Data Model
(EDM) by using the Microsoft ADO.NET Entity Data Model Designer (Entity Designer). The EDM
contains a complex type. You need to map a stored procedure to the complex type by using the
Entity Designer. What should you do?
You need to create and persist a relationship between person1 and territory1
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application.
You use the ADO.NET Entity Framework Designer to model entities as shown in the following
diagram.
You create an ObjectContext instance named objectContext1 and use it to create a SalesPerson
instance named person1. You also create an ObjectContext instance named objectContext2 and use
it to create a SalesTerritory instance named territory1. You need to create and persist a relationship
between person1 and territory1. What should you do?
Which code segment should you use?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application
that uses the Entity Framework. The application has an entity model that includes SalesTerritory and
SalesPerson entities as shown in the following diagram.
You need to calculate the total bonus for all sales people in each sales territory. Which code segment
should you use?
Which line of code should you insert at line 10?
You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL
Server 2008 database. You add the following table to the database.
CREATE TABLE ObjectCache (
Id INT IDENTITY PRIMARY KEY,
SerializedObjectData XML )
You write the following code segment to retrieve records from the ObjectCache table. (Line numbers
are included for reference only.)
01string s = GetConnectStringFromConfigFile(“xmldb”);
02using (SqlConnection conn = new SqlConnection(s))
03using (SqlCommand cmd = new SqlCommand(
04″select * from ObjectCache”, conn))
05{
06conn.Open();
07SqlDataReader rdr = cmd.ExecuteReader();
08while(rdr.Read())
09{
10
11DeserializeObject(obj);
12}
13}
You need to retrieve the data from the SerializedObjectData column and pass it to a method named
DeserializeObject. Which line of code should you insert at line 10?
Which code segment should you insert at line 06?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application
that uses the Entity Framework. You create the following Entity Data Model.
You write the following code. (Line numbers are included for reference only.)
01using (var context = new AdventureWorksLTEntities())
02{
03Customer cust = context.Customers.First();
04cust.CompanyName = “Contoso”;
05int count = 0;
06
07}
The changes to the cust entity must be saved. If an exception is thrown, the application must retry
the save 3 times. You need to add a code segment to meet the requirements. Which code segment
should you insert at line 06?
Which code segment should you use?
You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL
Server 2008 database. The application contains the following code segment.
stringSQL=string.Format
(“SELECT*FROMCustomerWHERECompanyNameLIKE’%{0}%'”,
companyName);
varcmd=newSqlCommand(SQL,con);
You need to reduce the vulnerability to SQL injection attacks. Which code segment should you use?
You need to ensure that the Storage Schema Definition Language (SSDL) of the EDM can be modified without rebui
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application
that uses the Entity Framework. You create an Entity Data Model (EDM) named Model. You need to
ensure that the Storage Schema Definition Language (SSDL) of the EDM can be modified without
rebuilding the application. What should you do?
Which code segment should you insert at line 05?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application
that uses the Entity Framework. You create the following Entity Data Model.
You write the following code. (Line numbers are included for reference only.)
01 Using context As New Model1Container()
02 Dim cust As Customer = context.Customers.First()
03 cust.CompanyName = “Contoso”
04 Dim count As Integer = 0
05
06 End Using
The changes to the cust entity must be saved. If an exception is thrown, the application must retry
the save 3 times. You need to add a code segment to meet the requirements. Which code segment
should you insert at line 05?
Which code segment should you insert at line 02?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application connects to a Microsoft SQL Server database. You create the classes shown in the
following exhibit.
You add the following code segment to the application. (Line numbers are included for reference
only.)
01Public Sub QueryPlayers(leagues As List(Of League))
02
03End Sub
You create a LINQ query to retrieve a collection of Player objects. You need to ensure that the
collection includes all the players from each team and every league. Which code segment should you
insert at line 02?
Which code segment should you insert at line 02?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application contains the following XML document.
< feed >
< title > Products < /title >
< entry >
< title > Entry title 1 < /title >
< author > Author1 < /title >
< content >
< properties >
< description > some description < /description >
< n otes > some notes < /notes >
< comments > some comments < /comments >
< /properties >
< /content >
< /entry >
…
< /feed >
You plan to add localization features to the application.
You add the following code segment. (Line numbers are included for reference only.)
01Public Function GetTextNodesForLocalization(doc As XDocument) As IEnumerable(Of XNode)
02
03Return From n In nodes _
04Where n.NodeType = XmlNodeType.Text _
05 Select n
06End Function
You need to ensure that the GetTextNodesForLocalization method returns all the XML text nodes of
the document. Which code segment should you insert at line 02?