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?

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?

A.
[FaultContract(typeof(DataFault))]

B.
[FaultContract(typeof(Exception))]

C.
[FaultContract(typeof(SqlException))]

D.
[FaultContract(typeof(FaultException))]



Leave a Reply 0

Your email address will not be published. Required fields are marked *