문제

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?

도움이 되었습니까?
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top