I have some routes store in my database tables like below :
/Customer/{Customer}/Address
/Customer/{Customer}/Address/{Address}
Above are just examples as i can have more routes also.
Now i want to generate routes dynamically in routeconfig by fetching from database in below routeconfig:
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//I am thinking to generate my routes dyncamically here.
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional }
);
}
}
So my question is how feasible this solution will be and if it is feasible then can we do same thing in wcf??