How do I Document Fault Contracts?

May 4, 2009 at 4:42 PM
Edited May 4, 2009 at 4:43 PM
I'm documenting a service interface that looks like:

[ServiceContract()]
interface IMyService{

   [OperationContract()]
   [FaultContract(typeof(InvalidInputFault))]
   [FaultContract(typeof(MyBusinessRuleFault))]
   int DoSomething(int i, int j);

}

since Sandcastle isn't WCF-aware, I need to document the operation's faults from a .NET perspective.  This means that the operation can throw a FaultException<InvalidInputFault> (which derived from exception) or a FaultException<MyBusinessRuleFault>

I've tried:

///

<exception cref="System.ServiceModel.FaultException{InvalidInputFault}">Means something bad happened</exception>

 

 

And I've tried

/// <exception cref="System.ServiceModel.FaultException<InvalidInputFault>">Means something bad happened</exception>

 

 

 

But neither have worked.  Any Ideas??

Editor
May 4, 2009 at 8:17 PM
Edited May 4, 2009 at 8:19 PM
Using a specific concrete type for a generic isn't supported in a cref target since it's something the compiler creates.  Use "FaultException{T}" instead so that it can link to the base generic type.  You can note the specific type name in the inner text if necessary.  For example:

/// <exception cref="System.ServiceModel.FaultException{T}">When the type is
/// <see cref="InvalidInputFault" />, something bad happened.</exception>

Eric
May 4, 2009 at 9:06 PM
Looks Good.  I'll go with that.