public FakeDiagnostics( IRootPathProvider rootPathProvider, IRequestTracing requestTracing, NancyInternalConfiguration configuration, IModelBinderLocator modelBinderLocator, IEnumerable <IResponseProcessor> responseProcessors, IEnumerable <IRouteSegmentConstraint> routeSegmentConstraints, ICultureService cultureService, IRequestTraceFactory requestTraceFactory, IEnumerable <IRouteMetadataProvider> routeMetadataProviders, ITextResource textResource, INancyEnvironment environment, ITypeCatalog typeCatalog) { this.diagnosticProviders = (new IDiagnosticsProvider[] { new FakeDiagnosticsProvider() }).ToArray(); this.rootPathProvider = rootPathProvider; this.requestTracing = requestTracing; this.configuration = configuration; this.modelBinderLocator = modelBinderLocator; this.responseProcessors = responseProcessors; this.routeSegmentConstraints = routeSegmentConstraints; this.cultureService = cultureService; this.requestTraceFactory = requestTraceFactory; this.routeMetadataProviders = routeMetadataProviders; this.textResource = textResource; this.environment = environment; this.typeCatalog = typeCatalog; }
public InfoModel(IRootPathProvider rootPathProvider, NancyInternalConfiguration configuration) { this.rootPathProvider = rootPathProvider; Configuration = new Dictionary <string, IEnumerable <string> >(); foreach (var propertyInfo in configuration.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public)) { var value = propertyInfo.GetValue(configuration, null); Configuration[propertyInfo.Name] = (!typeof(IEnumerable).IsAssignableFrom(value.GetType())) ? new[] { value.ToString() } : ((IEnumerable <object>)value).Select(x => x.ToString()); } var properties = SettingTypes .SelectMany(t => t.GetProperties(BindingFlags.Static | BindingFlags.Public)) .Where(x => x.PropertyType == typeof(bool)); Settings = from property in properties orderby property.Name let value = (bool)property.GetValue(null, null) select new SettingsModel { Name = Regex.Replace(property.Name, "[A-Z]", " $0"), Value = value }; }
public static NancyInternalConfiguration WithOpenApi(this NancyBootstrapperBase <TinyIoCContainer> bootstrapper, NancyConventions conventions, TinyIoCContainer container) { conventions.WithOpenApi(); container.WithOpenApi(); return(NancyInternalConfiguration.WithOverrides(nic => nic.ViewLocationProvider = typeof(ResourceViewLocationProvider))); }
/// <summary> /// Creates a new instance of the <see cref="DefaultDiagnostics"/> class. /// </summary> /// <param name="diagnosticProviders"></param> /// <param name="rootPathProvider"></param> /// <param name="requestTracing"></param> /// <param name="configuration"></param> /// <param name="modelBinderLocator"></param> /// <param name="responseProcessors"></param> /// <param name="routeSegmentConstraints"></param> /// <param name="cultureService"></param> /// <param name="requestTraceFactory"></param> /// <param name="routeMetadataProviders"></param> /// <param name="textResource"></param> public DefaultDiagnostics( IEnumerable <IDiagnosticsProvider> diagnosticProviders, IRootPathProvider rootPathProvider, IRequestTracing requestTracing, NancyInternalConfiguration configuration, IModelBinderLocator modelBinderLocator, IEnumerable <IResponseProcessor> responseProcessors, IEnumerable <IRouteSegmentConstraint> routeSegmentConstraints, ICultureService cultureService, IRequestTraceFactory requestTraceFactory, IEnumerable <IRouteMetadataProvider> routeMetadataProviders, ITextResource textResource, INancyEnvironment environment) { this.diagnosticProviders = diagnosticProviders; this.rootPathProvider = rootPathProvider; this.requestTracing = requestTracing; this.configuration = configuration; this.modelBinderLocator = modelBinderLocator; this.responseProcessors = responseProcessors; this.routeSegmentConstraints = routeSegmentConstraints; this.cultureService = cultureService; this.requestTraceFactory = requestTraceFactory; this.routeMetadataProviders = routeMetadataProviders; this.textResource = textResource; this.environment = environment; }
public InfoModule(IRootPathProvider rootPathProvider, NancyInternalConfiguration configuration) : base("/info") { Get["/"] = _ => View["Info"]; Get["/data"] = _ => { dynamic data = new ExpandoObject(); data.Nancy = new ExpandoObject(); data.Nancy.Version = string.Format("v{0}", this.GetType().Assembly.GetName().Version.ToString()); data.Nancy.CachesDisabled = StaticConfiguration.DisableCaches; data.Nancy.TracesDisabled = StaticConfiguration.DisableErrorTraces; data.Nancy.CaseSensitivity = StaticConfiguration.CaseSensitive ? "Sensitive" : "Insensitive"; data.Nancy.RootPath = rootPathProvider.GetRootPath(); data.Nancy.Hosting = this.GetHosting(); data.Nancy.BootstrapperContainer = this.GetBootstrapperContainer(); data.Nancy.LocatedBootstrapper = NancyBootstrapperLocator.Bootstrapper.GetType().ToString(); data.Nancy.LoadedViewEngines = GetViewEngines(); data.Configuration = new Dictionary <string, object>(); foreach (var propertyInfo in configuration.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public)) { var value = propertyInfo.GetValue(configuration, null); data.Configuration[propertyInfo.Name] = (!typeof(IEnumerable).IsAssignableFrom(value.GetType())) ? new[] { value.ToString() } : ((IEnumerable <object>)value).Select(x => x.ToString()); } return(Response.AsJson((object)data)); }; }
public static void Enable(DiagnosticsConfiguration diagnosticsConfiguration, IPipelines pipelines, IEnumerable<IDiagnosticsProvider> providers, IRootPathProvider rootPathProvider, IEnumerable<ISerializer> serializers, IRequestTracing requestTracing, NancyInternalConfiguration configuration, IModelBinderLocator modelBinderLocator, IEnumerable<IResponseProcessor> responseProcessors, ICultureService cultureService) { var keyGenerator = new DefaultModuleKeyGenerator(); var diagnosticsModuleCatalog = new DiagnosticsModuleCatalog(keyGenerator, providers, rootPathProvider, requestTracing, configuration, diagnosticsConfiguration); var diagnosticsRouteCache = new RouteCache(diagnosticsModuleCatalog, keyGenerator, new DefaultNancyContextFactory(cultureService), new DefaultRouteSegmentExtractor(), new DefaultRouteDescriptionProvider(), cultureService); var diagnosticsRouteResolver = new DefaultRouteResolver( diagnosticsModuleCatalog, new DefaultRoutePatternMatcher(), new DiagnosticsModuleBuilder(rootPathProvider, serializers, modelBinderLocator), diagnosticsRouteCache, responseProcessors); var serializer = new DefaultObjectSerializer(); pipelines.BeforeRequest.AddItemToStartOfPipeline( new PipelineItem<Func<NancyContext, Response>>( PipelineKey, ctx => { if (!ctx.ControlPanelEnabled) { return null; } if (!ctx.Request.Path.StartsWith(diagnosticsConfiguration.Path, StringComparison.OrdinalIgnoreCase)) { return null; } ctx.Items[ItemsKey] = true; var resourcePrefix = string.Concat(diagnosticsConfiguration.Path, "/Resources/"); if (ctx.Request.Path.StartsWith(resourcePrefix, StringComparison.OrdinalIgnoreCase)) { var resourceNamespace = "Nancy.Diagnostics.Resources"; var path = Path.GetDirectoryName(ctx.Request.Url.Path.Replace(resourcePrefix, string.Empty)) ?? string.Empty; if (!string.IsNullOrEmpty(path)) { resourceNamespace += string.Format(".{0}", path.Replace('\\', '.')); } return new EmbeddedFileResponse( typeof(DiagnosticsHook).Assembly, resourceNamespace, Path.GetFileName(ctx.Request.Url.Path)); } RewriteDiagnosticsUrl(diagnosticsConfiguration, ctx); return diagnosticsConfiguration.Valid ? ExecuteDiagnostics(ctx, diagnosticsRouteResolver, diagnosticsConfiguration, serializer) : GetDiagnosticsHelpView(ctx); })); }
public void Should_not_be_valid_if_any_types_null() { var config = NancyInternalConfiguration.WithOverrides((c) => c.ModelBinderLocator = null); var result = config.IsValid; result.ShouldBeFalse(); }
protected BootstrapperBaseFixtureBase() { this.configuration = NancyInternalConfiguration.WithOverrides( builder => { builder.NancyEngine = typeof(FakeEngine); }); }
public void Should_allow_overrides() { var fakeModelBinderLocator = A.Fake <IModelBinderLocator>(); var config = NancyInternalConfiguration.WithOverrides((c) => c.ModelBinderLocator = fakeModelBinderLocator.GetType()); var result = config.GetTypeRegistations(); result.Where(tr => tr.ImplementationType == fakeModelBinderLocator.GetType()).Any() .ShouldBeTrue(); }
public DiagnosticsStartup(DiagnosticsConfiguration diagnosticsConfiguration, IEnumerable <IDiagnosticsProvider> diagnosticProviders, IRootPathProvider rootPathProvider, IEnumerable <ISerializer> serializers, IRequestTracing requestTracing, NancyInternalConfiguration configuration, IModelBinderLocator modelBinderLocator) { this.diagnosticsConfiguration = diagnosticsConfiguration; this.diagnosticProviders = diagnosticProviders; this.rootPathProvider = rootPathProvider; this.serializers = serializers; this.requestTracing = requestTracing; this.configuration = configuration; this.modelBinderLocator = modelBinderLocator; }
public DefaultDiagnostics(DiagnosticsConfiguration diagnosticsConfiguration, IEnumerable <IDiagnosticsProvider> diagnosticProviders, IRootPathProvider rootPathProvider, IEnumerable <ISerializer> serializers, IRequestTracing requestTracing, NancyInternalConfiguration configuration, IModelBinderLocator modelBinderLocator, IEnumerable <IResponseProcessor> responseProcessors) { this.diagnosticsConfiguration = diagnosticsConfiguration; this.diagnosticProviders = diagnosticProviders; this.rootPathProvider = rootPathProvider; this.serializers = serializers; this.requestTracing = requestTracing; this.configuration = configuration; this.modelBinderLocator = modelBinderLocator; this.responseProcessors = responseProcessors; }
public void Should_not_be_valid_if_any_types_null() { // Given var config = NancyInternalConfiguration.WithOverrides((c) => c.ModelBinderLocator = null); // When var result = config.Invoke(this.typeCatalog).IsValid; // Then result.ShouldBeFalse(); }
public FakeDiagnostics(DiagnosticsConfiguration diagnosticsConfiguration, IRootPathProvider rootPathProvider, IRequestTracing requestTracing, NancyInternalConfiguration configuration, IModelBinderLocator modelBinderLocator, IEnumerable <IResponseProcessor> responseProcessors, ICultureService cultureService) { this.diagnosticsConfiguration = diagnosticsConfiguration; this.diagnosticProviders = (new IDiagnosticsProvider[] { new FakeDiagnosticsProvider() }).ToArray(); this.rootPathProvider = rootPathProvider; this.requestTracing = requestTracing; this.configuration = configuration; this.modelBinderLocator = modelBinderLocator; this.responseProcessors = responseProcessors; this.cultureService = cultureService; }
public void Should_allow_overrides() { // Given var fakeModelBinderLocator = A.Fake <IModelBinderLocator>(); var config = NancyInternalConfiguration.WithOverrides((c) => c.ModelBinderLocator = fakeModelBinderLocator.GetType()); // When var result = config.Invoke(this.typeCatalog).GetTypeRegistrations(); // Then result.Where(tr => tr.ImplementationType == fakeModelBinderLocator.GetType()).Any().ShouldBeTrue(); }
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines) { base.ApplicationStartup(container, pipelines); pipelines.EnableBasicAuthentication(new BasicAuthenticationConfiguration( container.Resolve <IUserValidator>(), "Couchbase XDCR")); StaticConfiguration.EnableRequestTracing = true; NancyInternalConfiguration.WithOverrides(c => { c.StatusCodeHandlers.Clear(); c.StatusCodeHandlers.Add(typeof(StatusCodeHandler)); } ); container.Register <IReplicationHandler>(new XmlReplicator()); }
public DefaultDiagnostics( DiagnosticsConfiguration diagnosticsConfiguration, IEnumerable <IDiagnosticsProvider> diagnosticProviders, IRootPathProvider rootPathProvider, IRequestTracing requestTracing, NancyInternalConfiguration configuration, IModelBinderLocator modelBinderLocator, IEnumerable <IResponseProcessor> responseProcessors, IEnumerable <IRouteSegmentConstraint> routeSegmentConstraints, ICultureService cultureService) { this.diagnosticsConfiguration = diagnosticsConfiguration; this.diagnosticProviders = diagnosticProviders; this.rootPathProvider = rootPathProvider; this.requestTracing = requestTracing; this.configuration = configuration; this.modelBinderLocator = modelBinderLocator; this.responseProcessors = responseProcessors; this.routeSegmentConstraints = routeSegmentConstraints; this.cultureService = cultureService; }
public void GetEngine_Defaults_Registered_In_Container() { // Given this.bootstrapper.GetEngine(); var defaults = NancyInternalConfiguration.WithOverrides(x => { x.ModuleKeyGenerator = typeof(WindsorModuleKeyGenerator); }); // When foreach (var registration in defaults.GetTypeRegistations().Where(x => x.RegistrationType != typeof(INancyEngine))) { this.bootstrapper.Container.Resolve(registration.RegistrationType) .ShouldBeOfType(registration.ImplementationType); } // NancyEngine is being proxied by Castle to intercept the HandleRequest call // Then this.bootstrapper.Container.Resolve <INancyEngine>() .GetType().Name.ShouldEqual("INancyEngineProxy"); }
private static TinyIoCContainer ConfigureContainer(IEnumerable <IDiagnosticsProvider> providers, IRootPathProvider rootPathProvider, IRequestTracing requestTracing, NancyInternalConfiguration configuration, DiagnosticsConfiguration diagnosticsConfiguration) { var diagContainer = new TinyIoCContainer(); diagContainer.Register <IInteractiveDiagnostics, InteractiveDiagnostics>(); diagContainer.Register <IRequestTracing>(requestTracing); diagContainer.Register <IRootPathProvider>(rootPathProvider); diagContainer.Register <NancyInternalConfiguration>(configuration); diagContainer.Register <IModelBinderLocator, DefaultModelBinderLocator>(); diagContainer.Register <IBinder, DefaultBinder>(); diagContainer.Register <IFieldNameConverter, DefaultFieldNameConverter>(); diagContainer.Register <BindingDefaults, BindingDefaults>(); diagContainer.Register <ISerializer>(new DefaultJsonSerializer { RetainCasing = false }); foreach (var diagnosticsProvider in providers) { var key = string.Concat( diagnosticsProvider.GetType().FullName, "_", diagnosticsProvider.DiagnosticObject.GetType().FullName); diagContainer.Register <IDiagnosticsProvider>(diagnosticsProvider, key); } foreach (var moduleType in AppDomainAssemblyTypeScanner.TypesOf <DiagnosticModule>().ToArray()) { diagContainer.Register(typeof(INancyModule), moduleType, moduleType.FullName).AsMultiInstance(); } return(diagContainer); }
public DiagnosticsModuleCatalog(IEnumerable <IDiagnosticsProvider> providers, IRootPathProvider rootPathProvider, IRequestTracing requestTracing, NancyInternalConfiguration configuration, DiagnosticsConfiguration diagnosticsConfiguration) { this.container = ConfigureContainer(providers, rootPathProvider, requestTracing, configuration, diagnosticsConfiguration); }
public static void OnConfigurationBuilder(NancyInternalConfiguration obj) { obj.ViewLocationProvider = typeof(ResourceViewLocationProvider); }
public FakeUnityNancyBootstrapper(NancyInternalConfiguration configuration) : this(configuration, null) { }
void OnConfigurationBuilder(NancyInternalConfiguration x) { x.ViewLocationProvider = typeof(ResourceViewLocationProvider); }
public FakeDefaultNancyBootstrapper() : this(NancyInternalConfiguration.WithOverrides(b => b.StatusCodeHandlers = new List <Type>(new[] { typeof(DefaultStatusCodeHandler) }))) { }
public FakeStructureMapNancyBootstrapper(NancyInternalConfiguration configuration) { this.configuration = configuration; }
static void OnConfigurationBuilder(NancyInternalConfiguration config) { config.ViewLocationProvider = typeof(ResourceViewLocationProvider); }
public FakeUnityNancyBootstrapper(NancyInternalConfiguration configuration, IUnityContainer container) { this.configuration = configuration; this.container = container; }
private void ConfigurationBuilder(NancyInternalConfiguration nancyInternalConfiguration) { nancyInternalConfiguration.ViewLocationProvider = typeof(ResourceViewLocationProvider); }
public FakeBootstrapper(NancyInternalConfiguration configuration) { this.configuration = configuration; }
public FakeDefaultNancyBootstrapper(NancyInternalConfiguration configuration) { this.configuration = configuration.WithIgnoredAssembly(asm => asm.FullName.StartsWith("TestAssembly")); this.RequestContainerInitialisations = new Dictionary <NancyContext, int>(); }
public static void Enable( DiagnosticsConfiguration diagnosticsConfiguration, IPipelines pipelines, IEnumerable <IDiagnosticsProvider> providers, IRootPathProvider rootPathProvider, IRequestTracing requestTracing, NancyInternalConfiguration configuration, IModelBinderLocator modelBinderLocator, IEnumerable <IResponseProcessor> responseProcessors, IEnumerable <IRouteSegmentConstraint> routeSegmentConstraints, ICultureService cultureService, IRequestTraceFactory requestTraceFactory, IEnumerable <IRouteMetadataProvider> routeMetadataProviders, ITextResource textResource) { var diagnosticsModuleCatalog = new DiagnosticsModuleCatalog(providers, rootPathProvider, requestTracing, configuration, diagnosticsConfiguration); var diagnosticsRouteCache = new RouteCache( diagnosticsModuleCatalog, new DefaultNancyContextFactory(cultureService, requestTraceFactory, textResource), new DefaultRouteSegmentExtractor(), new DefaultRouteDescriptionProvider(), cultureService, routeMetadataProviders); var diagnosticsRouteResolver = new DefaultRouteResolver( diagnosticsModuleCatalog, new DiagnosticsModuleBuilder(rootPathProvider, modelBinderLocator), diagnosticsRouteCache, new RouteResolverTrie(new TrieNodeFactory(routeSegmentConstraints))); var serializer = new DefaultObjectSerializer(); pipelines.BeforeRequest.AddItemToStartOfPipeline( new PipelineItem <Func <NancyContext, Response> >( PipelineKey, ctx => { if (!ctx.ControlPanelEnabled) { return(null); } if (!ctx.Request.Path.StartsWith(diagnosticsConfiguration.Path, StringComparison.OrdinalIgnoreCase)) { return(null); } ctx.Items[ItemsKey] = true; var resourcePrefix = string.Concat(diagnosticsConfiguration.Path, "/Resources/"); if (ctx.Request.Path.StartsWith(resourcePrefix, StringComparison.OrdinalIgnoreCase)) { var resourceNamespace = "Nancy.Diagnostics.Resources"; var path = Path.GetDirectoryName(ctx.Request.Url.Path.Replace(resourcePrefix, string.Empty)) ?? string.Empty; if (!string.IsNullOrEmpty(path)) { resourceNamespace += string.Format(".{0}", path.Replace(Path.DirectorySeparatorChar, '.')); } return(new EmbeddedFileResponse( typeof(DiagnosticsHook).Assembly, resourceNamespace, Path.GetFileName(ctx.Request.Url.Path))); } RewriteDiagnosticsUrl(diagnosticsConfiguration, ctx); return(diagnosticsConfiguration.Valid ? ExecuteDiagnostics(ctx, diagnosticsRouteResolver, diagnosticsConfiguration, serializer) : GetDiagnosticsHelpView(ctx)); })); }
public FakeDefaultNancyBootstrapper(NancyInternalConfiguration configuration) { this.configuration = configuration.WithIgnoredAssembly(asm => asm.FullName.StartsWith("TestAssembly")); this.RequestContainerInitialisations = new Dictionary<NancyContext, int>(); }
public FakeDefaultNancyBootstrapper(NancyInternalConfiguration configuration) { this.configuration = configuration; this.RequestContainerInitialisations = new Dictionary <NancyContext, int>(); }
public FakeDefaultNancyBootstrapper(NancyInternalConfiguration configuration) { this.configuration = configuration; this.RequestContainerInitialisations = new Dictionary<NancyContext, int>(); }
public FakeWindsorNancyBootstrapper(NancyInternalConfiguration configuration) { this.configuration = configuration; }
public DiagnosticsModuleCatalog(IEnumerable <IDiagnosticsProvider> providers, IRootPathProvider rootPathProvider, IRequestTracing requestTracing, NancyInternalConfiguration configuration, INancyEnvironment diagnosticsEnvironment, ITypeCatalog typeCatalog) { this.container = ConfigureContainer(providers, rootPathProvider, requestTracing, configuration, diagnosticsEnvironment, typeCatalog); }
public static void Enable(DiagnosticsConfiguration diagnosticsConfiguration, IPipelines pipelines, IEnumerable <IDiagnosticsProvider> providers, IRootPathProvider rootPathProvider, IEnumerable <ISerializer> serializers, IRequestTracing requestTracing, NancyInternalConfiguration configuration, IModelBinderLocator modelBinderLocator, IEnumerable <IResponseProcessor> responseProcessors) { var keyGenerator = new DefaultModuleKeyGenerator(); var diagnosticsModuleCatalog = new DiagnosticsModuleCatalog(keyGenerator, providers, rootPathProvider, requestTracing, configuration, diagnosticsConfiguration); var diagnosticsRouteCache = new RouteCache(diagnosticsModuleCatalog, keyGenerator, new DefaultNancyContextFactory(), new DefaultRouteSegmentExtractor()); var diagnosticsRouteResolver = new DefaultRouteResolver( diagnosticsModuleCatalog, new DefaultRoutePatternMatcher(), new DiagnosticsModuleBuilder(rootPathProvider, serializers, modelBinderLocator), diagnosticsRouteCache, responseProcessors); var serializer = new DefaultObjectSerializer(); pipelines.BeforeRequest.AddItemToStartOfPipeline( new PipelineItem <Func <NancyContext, Response> >( PipelineKey, ctx => { if (!ctx.ControlPanelEnabled) { return(null); } if (!ctx.Request.Path.StartsWith(ControlPanelPrefix, StringComparison.OrdinalIgnoreCase)) { return(null); } if (ctx.Request.Path.StartsWith(ResourcePrefix, StringComparison.OrdinalIgnoreCase)) { var resourceNamespace = "Nancy.Diagnostics.Resources"; var path = Path.GetDirectoryName(ctx.Request.Url.Path.Replace(ResourcePrefix, string.Empty)) ?? string.Empty; if (!string.IsNullOrEmpty(path)) { resourceNamespace += string.Format(".{0}", path.Replace('\\', '.')); } return(new EmbeddedFileResponse( typeof(DiagnosticsHook).Assembly, resourceNamespace, Path.GetFileName(ctx.Request.Url.Path))); } return(diagnosticsConfiguration.Valid ? ExecuteDiagnostics(ctx, diagnosticsRouteResolver, diagnosticsConfiguration, serializer) : GetDiagnosticsHelpView(ctx)); })); }
private static TinyIoCContainer ConfigureContainer(IEnumerable <IDiagnosticsProvider> providers, IRootPathProvider rootPathProvider, IRequestTracing requestTracing, NancyInternalConfiguration configuration, INancyEnvironment diagnosticsEnvironment, ITypeCatalog typeCatalog) { var diagContainer = new TinyIoCContainer(); diagContainer.Register <IInteractiveDiagnostics, InteractiveDiagnostics>(); diagContainer.Register <IRequestTracing>(requestTracing); diagContainer.Register <IRootPathProvider>(rootPathProvider); diagContainer.Register <NancyInternalConfiguration>(configuration); diagContainer.Register <IModelBinderLocator, DefaultModelBinderLocator>(); diagContainer.Register <IBinder, DefaultBinder>(); diagContainer.Register <IFieldNameConverter, DefaultFieldNameConverter>(); diagContainer.Register <BindingDefaults, BindingDefaults>(); diagContainer.Register <INancyEnvironment>(diagnosticsEnvironment); diagContainer.Register <ISerializer>(new DefaultJsonSerializer(diagnosticsEnvironment)); diagContainer.Register <ITypeCatalog>(typeCatalog); foreach (var diagnosticsProvider in providers) { var key = string.Concat( diagnosticsProvider.GetType().FullName, "_", diagnosticsProvider.DiagnosticObject.GetType().FullName); diagContainer.Register <IDiagnosticsProvider>(diagnosticsProvider, key); } foreach (var moduleType in typeCatalog.GetTypesAssignableTo <DiagnosticModule>()) { diagContainer.Register(typeof(INancyModule), moduleType, moduleType.FullName).AsMultiInstance(); } return(diagContainer); }