From 0e1f1ecd4077aa0338c0912e7fdc6793a218b75c Mon Sep 17 00:00:00 2001 From: tidusjar Date: Wed, 29 Jun 2016 17:06:58 +0100 Subject: [PATCH] Moved over to using Ninject --- PlexRequests.UI/Bootstrapper.cs | 114 +++++------------- PlexRequests.UI/Helpers/ServiceLocator.cs | 10 +- PlexRequests.UI/NinjectModules/ApiModule.cs | 50 ++++++++ .../NinjectModules/ConfigurationModule.cs | 55 +++++++++ .../NinjectModules/DependancyResolver.cs | 48 ++++++++ .../NinjectModules/RepositoryModule.cs | 52 ++++++++ .../NinjectModules/ServicesModule.cs | 55 +++++++++ .../NinjectModules/SettingServiceModule.cs | 40 ++++++ PlexRequests.UI/PlexRequests.UI.csproj | 18 +++ PlexRequests.UI/Startup.cs | 28 ++++- PlexRequests.UI/packages.config | 3 + 11 files changed, 383 insertions(+), 90 deletions(-) create mode 100644 PlexRequests.UI/NinjectModules/ApiModule.cs create mode 100644 PlexRequests.UI/NinjectModules/ConfigurationModule.cs create mode 100644 PlexRequests.UI/NinjectModules/DependancyResolver.cs create mode 100644 PlexRequests.UI/NinjectModules/RepositoryModule.cs create mode 100644 PlexRequests.UI/NinjectModules/ServicesModule.cs create mode 100644 PlexRequests.UI/NinjectModules/SettingServiceModule.cs diff --git a/PlexRequests.UI/Bootstrapper.cs b/PlexRequests.UI/Bootstrapper.cs index d29c9c324..249198332 100644 --- a/PlexRequests.UI/Bootstrapper.cs +++ b/PlexRequests.UI/Bootstrapper.cs @@ -32,43 +32,46 @@ using Mono.Data.Sqlite; using Nancy; using Nancy.Authentication.Forms; using Nancy.Bootstrapper; +using Nancy.Bootstrappers.Ninject; using Nancy.Conventions; using Nancy.Cryptography; using Nancy.Diagnostics; using Nancy.Session; -using Nancy.TinyIoc; -using PlexRequests.Api; using PlexRequests.Api.Interfaces; using PlexRequests.Core; using PlexRequests.Core.SettingModels; using PlexRequests.Helpers; -using PlexRequests.Services; using PlexRequests.Services.Interfaces; using PlexRequests.Services.Notification; using PlexRequests.Store; -using PlexRequests.Store.Models; using PlexRequests.Store.Repository; using PlexRequests.UI.Helpers; using Nancy.Json; -using PlexRequests.Helpers.Analytics; -using PlexRequests.Services.Jobs; -using PlexRequests.UI.Jobs; - -using Quartz; -using Quartz.Impl; -using Quartz.Spi; +using Ninject; namespace PlexRequests.UI { - public class Bootstrapper : DefaultNancyBootstrapper + public class Bootstrapper : NinjectNancyBootstrapper { // The bootstrapper enables you to reconfigure the composition of the framework, // by overriding the various methods and properties. // For more information https://github.com/NancyFx/Nancy/wiki/Bootstrapper - protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines) + public Bootstrapper(IKernel kernel) + { + _kernel = kernel; + } + + private IKernel _kernel; + protected override IKernel GetApplicationContainer() + { + _kernel.Load(); + return _kernel; + } + + protected override void ApplicationStartup(IKernel container, IPipelines pipelines) { ConfigureContainer(container); @@ -87,7 +90,7 @@ namespace PlexRequests.UI var formsAuthConfiguration = new FormsAuthenticationConfiguration { RedirectUrl = redirect, - UserMapper = container.Resolve() + UserMapper = container.Get() }; FormsAuthentication.Enable(pipelines, formsAuthConfiguration); @@ -115,40 +118,40 @@ namespace PlexRequests.UI protected override DiagnosticsConfiguration DiagnosticsConfiguration => new DiagnosticsConfiguration { Password = @"password" }; - private void SubscribeAllObservers(TinyIoCContainer container) + private void SubscribeAllObservers(IKernel container) { - var notificationService = container.Resolve(); + var notificationService = container.Get(); - var emailSettingsService = container.Resolve>(); + var emailSettingsService = container.Get>(); var emailSettings = emailSettingsService.GetSettings(); if (emailSettings.Enabled) { notificationService.Subscribe(new EmailMessageNotification(emailSettingsService)); } - var pushbulletService = container.Resolve>(); + var pushbulletService = container.Get>(); var pushbulletSettings = pushbulletService.GetSettings(); if (pushbulletSettings.Enabled) { - notificationService.Subscribe(new PushbulletNotification(container.Resolve(), pushbulletService)); + notificationService.Subscribe(new PushbulletNotification(container.Get(), pushbulletService)); } - var pushoverService = container.Resolve>(); + var pushoverService = container.Get>(); var pushoverSettings = pushoverService.GetSettings(); if (pushoverSettings.Enabled) { - notificationService.Subscribe(new PushoverNotification(container.Resolve(), pushoverService)); + notificationService.Subscribe(new PushoverNotification(container.Get(), pushoverService)); } - var slackService = container.Resolve>(); + var slackService = container.Get>(); var slackSettings = slackService.GetSettings(); if (slackSettings.Enabled) { - notificationService.Subscribe(new SlackNotification(container.Resolve(), slackService)); + notificationService.Subscribe(new SlackNotification(container.Get(), slackService)); } } - protected override void RequestStartup(TinyIoCContainer container, IPipelines pipelines, NancyContext context) + protected override void RequestStartup(IKernel container, IPipelines pipelines, NancyContext context) { //CORS Enable pipelines.AfterRequest.AddItemToEndOfPipeline((ctx) => @@ -161,68 +164,9 @@ namespace PlexRequests.UI base.RequestStartup(container, pipelines, context); } - private void ConfigureContainer(TinyIoCContainer container) + private void ConfigureContainer(IKernel container) { - container.Register().AsSingleton(); - container.Register(new DbConfiguration(new SqliteFactory())); - container.Register, UserRepository>(); - container.Register(); - container.Register(); - container.Register, SettingsServiceV2>(); - container.Register, SettingsServiceV2>(); - container.Register, SettingsServiceV2>(); - container.Register, SettingsServiceV2>(); - container.Register, SettingsServiceV2>(); - - // Notification Service - container.Register().AsSingleton(); - // Settings - container.Register, SettingsServiceV2>(); - container.Register, SettingsServiceV2>(); - container.Register, SettingsServiceV2>(); - container.Register, SettingsServiceV2>(); - container.Register, SettingsServiceV2>(); - container.Register, SettingsServiceV2>(); - - container.Register, SettingsServiceV2>(); - container.Register, SettingsServiceV2>(); - container.Register, SettingsServiceV2>(); - - // Repo's - container.Register, GenericRepository>(); - container.Register, GenericRepository>(); - container.Register, GenericRepository>(); - container.Register, GenericRepository>(); - container.Register, GenericRepository>(); - container.Register, GenericRepository>(); - container.Register(); - container.Register(); - container.Register(); - container.Register(); - - // Services - container.Register(); - container.Register(); - container.Register(); - container.Register(); - container.Register(); - - container.Register(); - container.Register(); - container.Register(); - - - // Api - container.Register(); - container.Register(); - container.Register(); - container.Register(); - container.Register(); - container.Register(); - container.Register(); - container.Register(); - container.Register(); - + var loc = ServiceLocator.Instance; loc.SetContainer(container); } diff --git a/PlexRequests.UI/Helpers/ServiceLocator.cs b/PlexRequests.UI/Helpers/ServiceLocator.cs index 40e82e434..54abe5bcd 100644 --- a/PlexRequests.UI/Helpers/ServiceLocator.cs +++ b/PlexRequests.UI/Helpers/ServiceLocator.cs @@ -28,6 +28,8 @@ using System; using Nancy.TinyIoc; +using Ninject; + namespace PlexRequests.UI.Helpers { public class ServiceLocator : IServiceLocator @@ -37,21 +39,21 @@ namespace PlexRequests.UI.Helpers Singleton = new ServiceLocator(); } private static ServiceLocator Singleton { get; } - private TinyIoCContainer Container { get; set; } + private IKernel Container { get; set; } public static ServiceLocator Instance => Singleton; - public void SetContainer(TinyIoCContainer con) + public void SetContainer(IKernel con) { Container = con; } public T Resolve() where T : class { - return Container?.Resolve(); + return Container?.Get(); } public object Resolve(Type type) { - return Container.Resolve(type); + return Container.Get(type); } } diff --git a/PlexRequests.UI/NinjectModules/ApiModule.cs b/PlexRequests.UI/NinjectModules/ApiModule.cs new file mode 100644 index 000000000..aad96d22b --- /dev/null +++ b/PlexRequests.UI/NinjectModules/ApiModule.cs @@ -0,0 +1,50 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: ApiModule.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion +using Ninject.Modules; + +using PlexRequests.Api; +using PlexRequests.Api.Interfaces; + +namespace PlexRequests.UI.NinjectModules +{ + public class ApiModule : NinjectModule + { + public override void Load() + { + Bind().To(); + Bind().To(); + Bind().To(); + Bind().To(); + Bind().To(); + Bind().To(); + Bind().To(); + Bind().To(); + Bind().To(); + Bind().To(); + } + } +} \ No newline at end of file diff --git a/PlexRequests.UI/NinjectModules/ConfigurationModule.cs b/PlexRequests.UI/NinjectModules/ConfigurationModule.cs new file mode 100644 index 000000000..5bb10dca3 --- /dev/null +++ b/PlexRequests.UI/NinjectModules/ConfigurationModule.cs @@ -0,0 +1,55 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: ConfigurationModule.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion +using Mono.Data.Sqlite; + +using Nancy; +using Nancy.Authentication.Forms; + +using Ninject.Modules; + +using PlexRequests.Core; +using PlexRequests.Helpers; +using PlexRequests.Services.Interfaces; +using PlexRequests.Services.Notification; +using PlexRequests.Store; + +namespace PlexRequests.UI.NinjectModules +{ + public class ConfigurationModule : NinjectModule + { + public override void Load() + { + Bind().To().InSingletonScope(); + Bind().To().WithConstructorArgument("provider", new SqliteFactory()); + + Bind().To(); + Bind().To(); + + Bind().To().InSingletonScope(); + } + } +} \ No newline at end of file diff --git a/PlexRequests.UI/NinjectModules/DependancyResolver.cs b/PlexRequests.UI/NinjectModules/DependancyResolver.cs new file mode 100644 index 000000000..3a245eced --- /dev/null +++ b/PlexRequests.UI/NinjectModules/DependancyResolver.cs @@ -0,0 +1,48 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: DependancyResolver.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion +using System; +using System.Linq; +using System.Reflection; + +using Ninject.Modules; + +namespace PlexRequests.UI.NinjectModules +{ + public class DependancyResolver + { + public NinjectModule[] GetModules() + { + var path = Assembly.GetAssembly(typeof(SettingServiceModule)).Location; + var result = Assembly.LoadFrom(path).GetTypes() + .Where(a => + a.IsClass && + a.BaseType == typeof(NinjectModule)); + + return result.Select(r => Activator.CreateInstance(r) as NinjectModule).ToArray(); + } + } +} \ No newline at end of file diff --git a/PlexRequests.UI/NinjectModules/RepositoryModule.cs b/PlexRequests.UI/NinjectModules/RepositoryModule.cs new file mode 100644 index 000000000..850926f74 --- /dev/null +++ b/PlexRequests.UI/NinjectModules/RepositoryModule.cs @@ -0,0 +1,52 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: RepositoryModule.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion +using Ninject.Modules; + +using PlexRequests.Core; +using PlexRequests.Services.Interfaces; +using PlexRequests.Services.Jobs; +using PlexRequests.Store; +using PlexRequests.Store.Repository; + +namespace PlexRequests.UI.NinjectModules +{ + public class RepositoryModule : NinjectModule + { + public override void Load() + { + Bind>().To>(); + Bind(typeof(IRepository<>)).To(typeof(GenericRepository<>)); + + Bind().To(); + Bind().To(); + Bind().To(); + Bind().To(); + Bind().To(); + } + + } +} \ No newline at end of file diff --git a/PlexRequests.UI/NinjectModules/ServicesModule.cs b/PlexRequests.UI/NinjectModules/ServicesModule.cs new file mode 100644 index 000000000..e2ce94dd7 --- /dev/null +++ b/PlexRequests.UI/NinjectModules/ServicesModule.cs @@ -0,0 +1,55 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: ServicesModule.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion +using Ninject.Modules; + +using PlexRequests.Helpers.Analytics; +using PlexRequests.Services.Interfaces; +using PlexRequests.Services.Jobs; +using PlexRequests.UI.Jobs; + +using Quartz; +using Quartz.Impl; +using Quartz.Spi; + +namespace PlexRequests.UI.NinjectModules +{ + public class ServicesModule : NinjectModule + { + public override void Load() + { + Bind().To(); + Bind().To(); + Bind().To(); + Bind().To(); + Bind().To(); + + Bind().To(); + Bind().To(); + Bind().To(); + } + } +} \ No newline at end of file diff --git a/PlexRequests.UI/NinjectModules/SettingServiceModule.cs b/PlexRequests.UI/NinjectModules/SettingServiceModule.cs new file mode 100644 index 000000000..309c5e281 --- /dev/null +++ b/PlexRequests.UI/NinjectModules/SettingServiceModule.cs @@ -0,0 +1,40 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: SettingServiceModule.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion +using Ninject.Modules; + +using PlexRequests.Core; + +namespace PlexRequests.UI.NinjectModules +{ + public class SettingServiceModule : NinjectModule + { + public override void Load() + { + Bind(typeof(ISettingsService<>)).To(typeof(SettingsServiceV2<>)); + } + } +} \ No newline at end of file diff --git a/PlexRequests.UI/PlexRequests.UI.csproj b/PlexRequests.UI/PlexRequests.UI.csproj index 0495bb18b..b04cda748 100644 --- a/PlexRequests.UI/PlexRequests.UI.csproj +++ b/PlexRequests.UI/PlexRequests.UI.csproj @@ -57,6 +57,10 @@ ..\packages\Nancy.1.4.3\lib\net40\Nancy.dll True + + ..\packages\Nancy.Bootstrappers.Ninject.1.4.1\lib\net40\Nancy.Bootstrappers.Ninject.dll + True + ..\packages\Nancy.Metadata.Modules.1.4.1\lib\net40\Nancy.Metadata.Modules.dll True @@ -65,6 +69,14 @@ ..\packages\Nancy.Swagger.0.1.0-alpha3\lib\net40\Nancy.Swagger.dll True + + ..\packages\Ninject.3.0.1.10\lib\net45-full\Ninject.dll + True + + + ..\packages\Ninject.Extensions.ChildKernel.3.0.0.5\lib\net45-full\Ninject.Extensions.ChildKernel.dll + True + ..\packages\NLog.4.3.4\lib\net45\NLog.dll True @@ -202,6 +214,12 @@ + + + + + + True True diff --git a/PlexRequests.UI/Startup.cs b/PlexRequests.UI/Startup.cs index 6f7f5fd8c..43e91815e 100644 --- a/PlexRequests.UI/Startup.cs +++ b/PlexRequests.UI/Startup.cs @@ -28,12 +28,17 @@ using System; using Nancy.TinyIoc; +using Ninject; +using Ninject.Modules; +using Ninject.Planning.Bindings.Resolvers; + using NLog; using Owin; using PlexRequests.UI.Helpers; using PlexRequests.UI.Jobs; +using PlexRequests.UI.NinjectModules; namespace PlexRequests.UI { @@ -45,7 +50,28 @@ namespace PlexRequests.UI { try { - app.UseNancy(); + var resolver = new DependancyResolver(); + var modules = resolver.GetModules(); + var kernel = new StandardKernel(modules); + + //kernel.Bind(x => x.FromThisAssembly() + // .SelectAllClasses() + // .InheritedFromAny( + // new[] + // { + // typeof(IRequestHandler<,>), + // typeof(IAsyncRequestHandler<,>), + // }) + // .BindDefaultInterfaces()); + + //kernel.Components.Add(); + //kernel.Bind(scan => scan.FromAssemblyContaining().SelectAllClasses().BindDefaultInterface()); + //kernel.Bind(scan => scan.FromAssemblyContaining().SelectAllInterfaces().BindAllInterfaces()); + + //kernel.Bind().ToMethod(ctx => t => ctx.Kernel.Get(t)); + //kernel.Bind().ToMethod(ctx => t => ctx.Kernel.GetAll(t)); + + app.UseNancy(options => options.Bootstrapper = new Bootstrapper(kernel)); var scheduler = new Scheduler(); scheduler.StartScheduler(); } diff --git a/PlexRequests.UI/packages.config b/PlexRequests.UI/packages.config index 7fa8497ea..e8f1649ae 100644 --- a/PlexRequests.UI/packages.config +++ b/PlexRequests.UI/packages.config @@ -19,6 +19,7 @@ + @@ -27,6 +28,8 @@ + +