I see RouteProvider.cs class in each Plugin, etc. but I wonder what calls these methods and where? It is a partial class but since they have their own namespaces, they cannot be combined. What class registers all these providers to RouteTable?
Thanks for the response but what calls RegisterRoutes() method in Nop.Web.Framework.Mvc.Routes.RoutePublisher. It seems something instantiate this class and pass a TypeFinder object which finds all the IRouteProvider. But I like to lean to see how this TypeFinder is implemented and what instantiates this RoutePublisher.
using System; using System.Collections.Generic; using System.Linq; using System.Web.Routing; using Nop.Core.Infrastructure;
In global.asax.cs IRoutePublisher is resolved to RoutePublisher (as defined in DependencyRegistrar) and method RegisterRoutes is called.
RegisterRoutes uses ITypeFinder to load all assemblies and look for a specific type (IRouteProvider in this case).
ITypeFinder is implemented by AppDomainTypeFinder and inherited by WebAppTypeFinder. WebAppTypeFinder is setup to resolve ITypeFinder, this happens in ContainerConfigurer.
To Summarize: On startup RoutePublisher.RegisterRoutes is called, which in turn uses AppDomainTypeFinder via WebAppTypeFinder to load all instances of IRouteProvider and call its RegisterRoutes method.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hai ancora qualche domanda o hai bisogno di aiuto?