How to change the OData EDM Model on the runtime

Viewed 623

In an OData service a dynamic EDM model had been registered and created

public static void Register(HttpConfiguration config)
{
    config.MapODataServiceRoute("OData", "odata", GetEdmModel());
}

GetEdmModel()

private static IEdmModel GetEdmModel()
{
    var modelBuilder = new ODataConventionModelBuilder(); 
    modelBuilder.AddEntitySet("Movies", modelBuilder.AddEntityType(externalEntity));
    return modelBuilder.GetEdmModel();
}

Accessing the Metadata URL give me the right model http://odatasample/OData/$metadata everything is running fine,

But the problem is externalEntity is not constant and can change in the runtime.

Is there is anyway to change the OData EDM Model in the runtime?

0 Answers
Related