How to make Entity Framework comments show in Sandcastle?

Sep 20, 2010 at 3:41 PM

I have some classes that are generated from an Entity Framework data model (.edmx file).  I'd like to comment them with Sandcastle.  The most natural course would be to enter the comments in the edmx's Documentation section, but Sandcastle is not picking up those comments.

How can I make Sandcastle document classes that are generated from the Entity Framework?

Sep 22, 2010 at 4:20 PM

As long as you've enabled generation of the XML comments file for the project containing the Entity Framework model classes, you should see their comments in the XML comments file generated by the build.  Note that only the <summary> element comments will get used.  the <LongDescription> element isn't a valid XML comments element and Sandcastle will not pick it up.  Support for it could be added to the Sandcastle XSL transformations to treat it like a <remarks> element if needed.  I'm not sure where you'd put documentation for the object context class itself and its members as there doesn't appear to be a place to add documentation for those items and they end up with the generic "no metadata available" comments.



Sep 22, 2010 at 10:13 PM

Thanks.  I didn't realize that one more aspect of my situation may be important, namely that I'm creating self-tracking entities per  Perhaps because of the extra links in the chain, the XML comments do not even include the summary information from the edmx.

Fortunately, the post at came to my rescue just moments ago.  It tells how to modify the .tt file to carry both the Summary and LongDescription into the XML comments.