moved Configuration class to its own file.

This commit is contained in:
chris.watts90@outlook.com 2017-01-31 22:01:42 +00:00
parent 8585f0fe77
commit dd8d91279f
3 changed files with 24 additions and 12 deletions

View File

@ -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<IHttpModule>().To<HttpApplicationInitializationHttpModule>();
//TODO: move to app.config. or ninject.xml or similar.
kernel.Bind<IRepository>().To<SQLiteRepository.SQLiteRepository>();
return kernel;
}
}
}

View File

@ -87,18 +87,6 @@ namespace WindowsDataCenter
}
}
public static class Configuration
{
public static StandardKernel ConfigureNinject(SQLiteConnection conn)
{
var kernel = new StandardKernel();
kernel.Bind<SQLiteConnection>().ToConstant(conn);
kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();
return kernel;
}
}
public sealed class CardUniqueId
{
[PrimaryKey, AutoIncrement]

View File

@ -126,7 +126,11 @@
<ItemGroup>
<Compile Include="CardData.cs" />
<Compile Include="CardsController.cs" />
<Compile Include="Configuration.cs" />
<Compile Include="JsonpFormatter.cs" />
<Compile Include="NinjectDependencyResolver.cs" />
<Compile Include="NinjectDependencyScope.cs" />
<Compile Include="NinjectHelper.cs" />
<Compile Include="RestService_Get.cs" />
<Compile Include="RestService_Post.cs" />
<Compile Include="Service1.cs">