Asp.Net Core: Have to find a way to dynamically register EDM & ODataControllers *after* event()

Sky S 1 Reputation point


We're in a bit of a (real) bind.

We need to demonstrate to stakeholders that Asp.Net Core stack is still a viable platform for this project which MUST loading plugins containing an set of WebAPI and OData Controllers unknown at startup. Due to our lack of success so far everybody is getting jumpy.


  • one solution, one project
  • with 2 ODataControllers,
  • One Convention based EDM model registered during startup, pointing to only one of the two ODataControllers
  • such that when invoked (ie way after Build),
  • registers a second EDM model that points to the second ODataController.
  • proving:
  • ODataControllers can be registered late (as if they had just been made available via a plugin)

We have not envisioned yet know how to prove the same with two simple WebAPI (not OData) Controllers -- as they are automatically spotted/found/registered at startup.

For bonus points, if anyone knows any/elegant? way to register Services late (eg: those that came in via the Plugin)...but I think StackOverflow is littered with that question, and no straight forward answers.

Thank you!

A set of technologies in the .NET Framework for building web applications and XML web services.
4,378 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce ( 61,181 Reputation points

    your goal is not clear. controllers are already a plugin model. you just publish to the bin folder and restart.

    if you need dynamic loading and routing then:

    to implement true plugins see:

    you would have a master controller that called the proper plugin.

    for dynamic routing see:[@](/users/na/?userId=0e4b2b59-4001-0003-0000-000000000000)/dynamic-controller-routing-in-asp-net-5-ac81a6bb8a95