What should you do?
You are modifying a Windows Communication Foundation (WCF) service that allows customers to update financial data.
The service currently requires a transaction from the client application and is working correctly.
The service contract is defined as follows. (Line numbers are included for reference only.)
01 [ServiceContract()]
02 public interface IDataUpdate
03 {
04 [OperationContract()]
05 [TransactionFlow(TransactionFlowOption.Mandatory)]
06 void Update(string accountNumber, double amount);
07
08 }
09
10 public class UpdateService : IDataUpdate
11 {
12
13 [OperationBehavior(TransactionScopeRequired=true, TransactionAutoComplete=true)]
14 public void Update(string accountNumber, double amount)
16 {
17 try
18 {
19 …
20 }
19 catch(Exception ex)
20 {
21 …
22 }
23 }
24 }
The service must be modified so that client applications do not need to initiate a transaction when calling the operation.
The service must use the client applications transaction if one is available. Otherwise it must use its own transaction.
You need to ensure that the service operation is always executed within a transaction. What should you do?
Which code fragment should you add to the .edmx file?
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 model entities. You create an entity as shown in the following code fragment.
<EntityType Name=”ProductCategory”>
<Key>
<PropertyRef Name=”ProductCategoryID” />
</Key>
<Property Name=”ProductCategoryID” Type=”int” Nullable=”false” StoreGeneraedPattern=”Identity” />
<Property Name=”ParentProductCategoryID” Type=”int” />
<Property Name=”Name” Type=”nvarchar” Nullable=”false” MaxLength=”50″ />
…
</EntityType>
You need to provide two entity-tracking fields:
* rowguid that is automatically generated when the entity is created
* ModifiedDate that is automatically set whenever the entity is updated.
Which code fragment should you add to the .edmx file?
What should you do?
You are designing a Windows Presentation Foundation (WPF) application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010.
The application will be deployed on Windows 7 computers in the United States and Europe.
You need to ensure that array data is sorted based on the culture of the operating system.
What should you do?
Which approach should you recommend?
You need to design an exception-handling strategy for the Web application.
Which approach should you recommend?
Which configuration segment should you add to the <System.Diagnostics> element?
You are developing a Windows Communication Foundation (WCF) service.
The service configuration file has a <System.Diagnostics> element defined.
You need to ensure that all security audit information, trace logging, and message logging failures are recorded.
Which configuration segment should you add to the <System.Diagnostics> element?
Which method should you call?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
You manually create your own Context class named AdventureWorksDB that inherits from ObjectContext.
You need to use AdventureWorksDB to invoke a stored procedure that is defined in the data source.
Which method should you call?
What should you do?
You are designing an application by using Windows Presentation Foundation (WPF) and Microsoft .NET Framework 4.
The user interface (UI) tier of the application will be implemented in WPF.
The middle tier of the application is implemented by using an existing COM component.
The middle tier contains a long-running method named ProcessData.
You need to ensure that users can continue to use the UI while ProcessData is running.
What should you do?
Which approach should you recommend?
You need to design a solution for capturing an exception.
Which approach should you recommend?
Which configuration segment should you use?
You are developing a Windows Communication Foundation (WCF) service.
You must record all available information for the first 1,000 messages processed, even if they are malformed.
You need to configure the message logging section of the configuration file. Which configuration segment should you use?
Which method should you call on the ObjectContext?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server database. The application uses the ADO.NET Entity Framework to manage order data.
The application makes a Web service call to obtain orders from an order-tracking system.
You need to ensure that the orders are added to the local data store. Which method should you call on the ObjectContext?