Question

All of the webapi+odata examples I've seen so far build the model in WebApiConfig.Register using something like:

...
var modelBuilder = new ODataConventionModelBuilder();
modelBuilder.EntitySet<AClass>("SetName");
...
IEdmModel model = modelBuilder.GetEdmModel();

In my case, I would like to dynamically build the classes used in modelBuilder.EntitySet<AClass>("SetName") at runtime and register them on the fly, the first time a request for this entity set is executed.

I've read this article where EdmEntityObject is used when no backing CLR type is available but the model is still built during the startup of the service.

Is there a way to build the model on the fly?

Était-ce utile?

La solution

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top