Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Feature: Add support for documentation to ODataConventionModelBuilder [784]

$
0
0
This can be done easily by looking for the System.ComponentModel.Description attribute on entities and properties, and using the EDM model's SetDocumentation() method.
Comments: ``` private static IEdmModel GetEdmModel() { ODataConventionModelBuilder builder = new ODataConventionModelBuilder(); builder.EntitySet<Customer>("Customers"); builder.EntitySet<Order>("Orders"); IEdmModel model = builder.GetEdmModel(); DocumentModel(model); return model; } private static void DocumentModel(IEdmModel model) { foreach (IEdmType edmType in model.SchemaElements.OfType<IEdmType>()) { Type clrType = model.GetAnnotationValue<ClrTypeAnnotation>(edmType).ClrType; model.SetDocumentation(edmType, new EdmDocumentation("Summary", "Description")); } } ```

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>