PrepAway - Latest Free Exam Questions & Answers

Which code segment should you add?

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You have successfully defined a service contract named IManageOrders.
You write the following code segment.

public class OrderImpl : IManageOrders
{
public void MarkOrderClosed(int orderId)
{
try{ }
catch (SqlException exc) { throw new FaultException<DataFault>(new DataFault()); }
}
}
[DataContract]
public class DataFault{ }

You need to create a fault contract for the MarkOrderClosed method on the IManageOrders service contract.
Which code segment should you add?

PrepAway - Latest Free Exam Questions & Answers

A.
[FaultContract(typeOf(DataFault))]

B.
[FaultContract(typeOf(Exception))]

C.
[FaultContract(typeOf(SqlException))]

D.
[FaultContract(typeOf(FaultException))]


Leave a Reply