From dd8d91279fc0a14384934a0ca1f6d693e804a1a4 Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Tue, 31 Jan 2017 22:01:42 +0000 Subject: [PATCH] moved Configuration class to its own file. --- .../WindowsDataCenter/Configuration.cs | 20 +++++++++++++++++++ .../WindowsDataCenter/Service1.cs | 12 ----------- .../WindowsDataCenter.csproj | 4 ++++ 3 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Configuration.cs diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Configuration.cs b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Configuration.cs new file mode 100644 index 0000000..a011f4f --- /dev/null +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Configuration.cs @@ -0,0 +1,20 @@ +using System.Web; +using Interfaces; +using Ninject; +using Ninject.Web.Common; + +namespace WindowsDataCenter +{ + public static class Configuration + { + public static StandardKernel ConfigureNinject() + { + var kernel = new StandardKernel(); + kernel.Bind().To(); + //TODO: move to app.config. or ninject.xml or similar. + kernel.Bind().To(); + + return kernel; + } + } +} \ No newline at end of file diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Service1.cs b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Service1.cs index 1ed6272..f68b97e 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Service1.cs +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Service1.cs @@ -87,18 +87,6 @@ namespace WindowsDataCenter } } - public static class Configuration - { - public static StandardKernel ConfigureNinject(SQLiteConnection conn) - { - var kernel = new StandardKernel(); - kernel.Bind().ToConstant(conn); - kernel.Bind().To(); - - return kernel; - } - } - public sealed class CardUniqueId { [PrimaryKey, AutoIncrement] diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/WindowsDataCenter.csproj b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/WindowsDataCenter.csproj index dd2c6a3..5e76f42 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/WindowsDataCenter.csproj +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/WindowsDataCenter.csproj @@ -126,7 +126,11 @@ + + + +