<?xml version="1.0" encoding="utf-8"?
Refer to the following lines in the case study: PA40 in \Model\Part.cs, PR16 in\Model\Product.cs, and CT14 in \Model\Component.cs
The application must create XML files that detail the part structure for any product. The XML files must use the following format:
<?xml version=”1.0″ encoding=”utf-8″?>
<product name=”Brush” description=”Brush product” productType=”1″>
<component name=”Handle” description=”Handle” partType=”2″>
<component name=”Screw” description=”Screw” partType=”3″>
<component name=”Wood” description=”Wooden shaft” partType=”45″>
</component>
<component name=”Head” description=”Head” partType=”5″>
<component name=”Screw” description=”Screw” partType=”3″>
<component name=”Bristles” description=”Bristles” partType=”4″>
</component>
</product>
You need to update the application to support the creation of an XElement object having a structure that will serialize to the format shown above.
What should you do? (Each correct answer presents part of the solution. Choose two.)
Which two actions should you perform?
You create a Visual Studio 2010 solution that includes a WCF service project and an ASP.NET project.
The service includes a method named GetPeople that takes no arguments and returns an array of Person objects.
The ASP.NET application uses a proxy class to access the service.
You use the Add Service Reference wizard to generate the class.
After you create the proxy, you move the service endpoint to a different port.
You need to configure the client to use the new service address.
In addition, you must change the implementation so that calls to the client proxy will return a List<Person> instead of an array.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
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.)
01 public void QueryPlayers(List <League> leagues) {
02
03 }
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?
What should you do?
You are creating a Windows Communication Foundation (WCF) service based on WSHttpBinding. New audit requirements dictate that callers must be authenticated on every call to ensure that their credentials have not been revoked. You need to ensure that the service will not cache the security request token. What should you do?
What should you do?
You have an existing ContosoEntities context object named context.
Calling the SaveChanges() method on the context object generates an exception that has the following inner exception:
System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object ‘dbo.Colors’ with unique index ‘IX_Colors’.
You need to ensure that a call to SaveChanges() on the context object does not generate this exception. What should you do?
Which code segment should you use?
You are implementing an ASP.NET Web site.
The site uses a component that must be dynamically configured before it can be used within site pages.
You create a static method named SiteHelper.Configure that configures the component.
You need to add a code segment to the Global.asax file that invokes the SiteHelper.Configure method the first time, and only the first time, that any page in the site is requested.
Which code segment should you use?
What should you do?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server 2008 database. The application uses DataContexts to query the database. You create a function that meets the following requirements: “Updates the Customer table on the database when a customer is marked as deleted. “Updates the related entries in other tables (CustomerAddress, CustomerContacts) by marking them as deleted. “Prevents consumer code from setting the Deleted column’s value directly. You need to ensure that the function verifies that customers have no outstanding orders before they are marked as deleted. You also need to ensure that existing applications can use the update function without requiring changes in the code. What should you do?
What should you do?
The endpoint of a Windows Communication Foundation (WCF) service uses basicHttpBinding for its binding. Your company’s policies have changed to require that messages not be sent in clear text. You must ensure that all messages are encrypted when traveling across the network. What should you do?
Which connection string fragment should you use?
The application must be configured to run on a new development computer.
You need to configure the connection string to point to the existing named instance.
Which connection string fragment should you use?
What should you do?
You are implementing an ASP.NET Web site.
The root directory of the site contains a page named Error.aspx.
You need to display the Error.aspx page if an unhandled error occurs on any page within the site.
You also must ensure that the original URL in the browser is not changed.
What should you do?