11.07.2015 Views

y - Net Developer

y - Net Developer

y - Net Developer

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 9 ■ USING TRANSACTIONS IN WCF 289ramrameshreddy.blog.comNow that you have accomplished this, you can enhance the trade service so you canaccomplish your goals. You will enhance the CalculateTradeValue() method in order to beable to accommodate the trade and log being handled in a single transaction.Next you’ll modify ITradeService of the QuickReturns Ltd. trade service in the same manneras you did for the client. Please refer to Listing 9-7 for details.Listing 9-7. Modifying ITradeService in the QuickReturns Ltd. Trade Serviceusing System;using System.ServiceModel;using System.Transactions;using System.Configuration;using System.Data.SqlClient;using System.Globalization;namespace QuickReturns{// Define a service contract.[ServiceContract(Namespace = "QuickReturns")]public interface ITradeService{[OperationContract][TransactionFlow(TransactionFlowOption.Mandatory)]int CalculateTradeValue(int qty, int price);ramrameshreddyramrameshreddy}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!