Comments (6)
On 2013-04-02 03:06:18 UTC, HongmeiG commented:
Nice feature request Thargy! Today you could add the documentation yourself after the model is built by the conventional model builder.
from webapi.
On 2013-04-09 08:35:58 UTC, raghuramn commented:
private static IEdmModel GetEdmModel()
{
ODataConventionModelBuilder builder = new ODataConventionModelBuilder();
builder.EntitySet("Customers");
builder.EntitySet("Orders");
IEdmModel model = builder.GetEdmModel();
DocumentModel(model);
return model;
}
private static void DocumentModel(IEdmModel model)
{
foreach (IEdmType edmType in model.SchemaElements.OfType())
{
Type clrType = model.GetAnnotationValue(edmType).ClrType;
model.SetDocumentation(edmType, new EdmDocumentation("Summary", "Description"));
}
}
from webapi.
On 2013-09-06 05:56:56 UTC, KevinBurton commented:
So for the slow how is this used? For example one of the resources that I am adding looks like:
var schedules = modelBuilder.EntitySet("Schedules");
A portion of the ScheduleRepresentation looks like:
public class ScheduleRepresentation
{
[Key]
public string Id { get; set; }
public string Name { get; set; }
public string TitleType { get; set; }
public string FolderId { get; set; }
Is it as simple as adding /// comments to each property? If so should they be ///
?
Thank you.
from webapi.
On 2013-09-06 07:23:08 UTC, raghuramn commented:
@kevin: we don't automatically parse the xml documentation and populate the model with it. The above sample shows how to annotate an EDM model with documentation. You should write code to parse the xml doc file or wherever your documentation lives and
annotate your model.
from webapi.
@LianwMS I'm trying to use your method posted on Jan 11th to simply set the documentation. I am finding that the SetDocumentation method is internal, how then can this be done at this point?
Here is the Edm version I'm using.
Here is the static method.
internal static void SetDocumentation(this IEdmModel model, IEdmElement element, IEdmDocumentation documentation)
I've been trying to muck around to find how to do this but it's slow going.
from webapi.
Close this because OData V4 spec doesn't have Document element.
from webapi.
Related Issues (20)
- Swagger generator is missing $filter from EntitySet "get" definitions HOT 3
- NullReferenceException in ExpandQueryBuilder when using camelCase property names HOT 2
- Cannot serialize EdmDeltaComplexObject in odata 7x and above
- OData $filter=contains and NullReferenceExceptions in LINQ to SQL HOT 2
- GeneateActionLink should apply lowercase for bindingParameterType HOT 1
- ODataConventionModelBuilder GetEdmModel() System.Data.Linq FileNotFoundException HOT 2
- NU1608: Detected package version outside of dependency constraint: Microsoft.AspNet.WebApi.OData 5.7.0 requires Microsoft.AspNet.WebApi.Core (>= 5.2.2 && < 5.3.0) but version Microsoft.AspNet.WebApi.Core 5.3.0 was resolved. HOT 2
- The property '{propertyname}' cannot be used in the $expand query option HOT 6
- OData-prefix missing in delta responses
- Make the query validator thread-safe since the validator is singleton
- 'Microsoft.AspNet.WebApi.Core 5.3.0' is not compatible with 'Microsoft.AspNet.OData 7.7.2 constraint: Microsoft.AspNet.WebApi.Core (>= 5.2.2 && < 5.3.0)' HOT 2
- Odata MongoDb lt filtering HOT 2
- JsonIgnore with condition incorrectly ignoring property when using OData $select query with [EnableQuery] endpoint HOT 2
- [Microsoft.AspNet.OData v7.7.3] Request.ODataProperties().NextLink is always null
- InvalidOperationException thrown from CreateRequestContainer cause performance issue HOT 9
- IHttpContextAccessor.HttpContext.User is not always authenticated (when it should) when invoked by IModelCacheKeyFactory HOT 5
- Group by a property of a derived type is not supported HOT 1
- Perf: OData performance regressions found between 6.0.0 and 7.7.4
- Invalid JSON when using List<List<?>> property HOT 2
- Faulty link generation when creating entities with string key and slashes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webapi.