public BasicFubuStructureMapRegistry(bool enableDiagnostics, string controllerAssemblyName) { Applies.ToAssembly(controllerAssemblyName); Actions .IncludeTypesNamed(x => x.EndsWith("Controller")); Routes .IgnoreControllerNamespaceEntirely(); }
public HandlerActionSource(IEnumerable <Type> markerTypes) { markerTypes.Each(markerType => { Applies.ToAssembly(markerType.Assembly); IncludeTypes(x => x.Namespace.IsNotEmpty() && x.Namespace.StartsWith(markerType.Namespace)); IncludeMethods(x => x.Name == HandlersUrlPolicy.METHOD); }); _markerTypes = markerTypes; }
public void ApplyHandlerConventions(Func <Type[], HandlersUrlPolicy> policyBuilder, params Type[] markerTypes) { markerTypes.Each(t => Applies.ToAssembly(t.Assembly)); var source = new HandlerActionSource(markerTypes); if (!_actionSources.Contains(source)) { Routes.UrlPolicy(policyBuilder(markerTypes)); Actions.FindWith(source); } }
public BasicFubuStructureMapRegistry(bool enableDiagnostics, string controllerAssemblyName) { Applies.ToAssembly(controllerAssemblyName); Actions .IncludeTypesNamed(x => x.EndsWith("Controller")); Routes .IgnoreControllerNamespaceEntirely(); Views.TryToAttach(x => { x.by_ViewModel_and_Namespace_and_MethodName(); x.by_ViewModel_and_Namespace(); x.by_ViewModel(); }); }