Fault Contract Interview Questions and Answers

By adminLast updated: Sunday, December 22, 2013 • Save & ShareLeave a Comment

Fault Contract Interview Questions and Answers

1) What is Fault Contract ?

Ans) It is a attribute need to be decorated on top of the Method definition in Interface. Example: [ServiceContract] public interface IMathService { [OperationContract]> }

2) Why I need to user typeof() keyword in Fault Contract ?

Ans) If you want use FaultContract attribute it is mandatory to define type with some DataContract class.

3) What is difference between Fault Contract and Fault Exception ?

Ans) Fault Contract is a class need to decorate on the top of the method definition in interface and Fault Exception is class will be come as the part of try & catch block.

4) Is it mandatory if I want to use Fault Exception class I need to decorate Fault contract attribute to method definition ?

Ans) Yes. You can use only Fault Exception when you declare Fault Contract attribute.

5) Can I through Fault Exception in try block it self like through new Exception(..) ?

Ans) Yes, you can through exception in try block.
Example:
try
{
if (a==null)
{
throw new FaultException(CalculationDtls);
}
}

6) Is it possible to throw Fault exception in Catch ?

Ans) Yes.

7) Can I use any DataContract Class as type of Fault Contract ?

Ans) Yes. You can use any of the DataContract class.

7) Where can I find full blog of this topic ?

Ans) You can find on top the article link.

Fault Contract Interview Questions and Answers related blog’s (Internal)
Fault Contract Interview Questions and Answers related blog’s(Internal)

Leave a Reply