Giter Site home page Giter Site logo

Comments (6)

LianwMS avatar LianwMS commented on June 25, 2024

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.

LianwMS avatar LianwMS commented on June 25, 2024

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.

LianwMS avatar LianwMS commented on June 25, 2024

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.

LianwMS avatar LianwMS commented on June 25, 2024

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.

jeffabailey avatar jeffabailey commented on June 25, 2024

@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.

xuzhg avatar xuzhg commented on June 25, 2024

Close this because OData V4 spec doesn't have Document element.

from webapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.