Only show document for properties/functions with data contract attribute

Mar 18, 2011 at 8:47 AM

Hi, I'm using SandCastle to create CHM document for our system exposed API. The API datatype/messagetype is written in C# and then generate the WSDL via svcutil.

in the C# datatype/messeagetype definition, we include both public properties with [Datamember] attribute and other public properties which are intended for internal usage.

So my question is: is there anyway to only generate document for those exposed properties with data contract attribute and hide other public properties which do not have data contract attribute?

Mar 18, 2011 at 7:37 PM

You can use the API filter feature to remove unwanted members from the documentation.  If you're using the Sandcastle Help File Builder or DocProject, they contain options to help you select the members for removal.  If you're using the Sandcastle tools by themselves from the command line, you'll need to add the filter manually to the MRefBuilder configuration file.  If by "internal usage" you mean only for use by classes within the assembly in which they reside, another option would be to declare the members in question as "internal" rather than "public".  That would remove them from the public interface and would omit them from the documentation by default.