I want to stroe my routes in DB and register them in Application_Start of Global.asax.cs. Everything is fine but any change in the DB, I have to reset the app in order to let app to pick up my changes.
If i can reset the routes without restart the app, the problem will be solved. How would I achive it geeks? A custom httpmodule? or...
public static void UpdateRouteRegistration() {
RouteCollection routes = RouteTable.Routes;
using (routes.GetWriteLock()) {
routes.Clear();
// repopulate route table here
}
}
Then call this method from Application_Start and any other time you need to initialize the route table. Note: This is from memory and might be slightly mistyped, but you get the idea. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With