public IEnumerable <ControllerInfo> GetControllers() { return (from t in GetControllerTypes() where !this.Settings.IgnoredControllers.Contains(t) let c = CodeRoutingProvider.AnalyzeControllerType(t, this) where c != null && c.IsInRootNamespace select c); }
public static void RegisterProvider(CodeRoutingProvider provider) { if (provider == null) { throw new ArgumentNullException("provider"); } lock (staticLock) { providers.Add(provider); } }
public RegisterSettings(Assembly assembly, Type rootController) { if (rootController != null) { if (CodeRoutingProvider.GetProviderForControllerType(rootController) == null || !IsValidControllerType(rootController)) { throw new InvalidOperationException("The specified root controller is not a valid controller type."); } if (assembly != null && rootController.Assembly != assembly) { throw new InvalidOperationException("The specified root controller does not belong to the specified assembly."); } } else if (assembly == null) { throw new ArgumentException("Either assembly or rootController must be specified."); } this.Assembly = assembly; this.RootController = rootController; }
static CodeRoutingHttpExtensions() { CodeRoutingProvider.RegisterProvider(new HttpCodeRoutingProvider()); }
static CodeRoutingExtensions() { CodeRoutingProvider.RegisterProvider(new Web.Mvc.MvcCodeRoutingProvider()); }