News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

Advertisement

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;
[ServiceContract]
public interface IContosoService
{
[OperationContract]
void SavePerson(Person person);
}

They also use the following binding.

NetTcpBinding binding = new NetTcpBinding { TransactionFlow = true };

The client calls the service with the following code

using (TransactionScope ts = new TransactionScope(TransactionScopeOption.
Required))
{
IContosoService client = factory.CreateChannel();
client.SavePerson(person);
Console.WriteLine(Transaction.Current.TransactionInformation.DistributedIdentifier);
ts.Complete();
}

The service has the following implementation for SavePerson

public void IContosoService.SavePerson(Person person)
{
person.Save();
Console.WriteLine(Transaction.Current.TransactionInformation.
DistributedIdentifier);
}

The distributed identifiers do not match on the client and the serve.r You need to ensure that the client and server enlist in the same distributed transaction. What should you do?

  1. Add the following attributes to the SavePerson operation on IContosoService.

    [OperationBehavior(TransactionScope.Required = true)]
    [TransactionFlow(TransactionFlowOption.Mandatory)]
  2. Add the following attributes to the SavePerson operation on lContosoService

    [TransactionFlow(TransactionFlowOption.Mandatory)]
    [OperationBehavior(TransactionScope.Required = true)]
  3. Add the following attribute to the SavePerson operation on lContosoService

    [OperationBehavior(TransactionScope.Required = true)]

    Add the following attribute to the implementation of SavePerson.

    [TransactionFlow(TransactionFlowOption.Allowed)]
  4. Add the following attribute to the SavePerson operation on lContosoService

    [TransactionFlow(TransactionFlowOption.Allowed)]

    Add the following attribute to the implementation of SavePerson

    [OperationBehavior(TransactionScope.Required = true)]
Answer: Answer is d
comments powered by Disqus
Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;