moved Configuration class to its own file.
This commit is contained in:
parent
8585f0fe77
commit
dd8d91279f
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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
|
public sealed class CardUniqueId
|
||||||
{
|
{
|
||||||
[PrimaryKey, AutoIncrement]
|
[PrimaryKey, AutoIncrement]
|
||||||
|
|||||||
@ -126,7 +126,11 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="CardData.cs" />
|
<Compile Include="CardData.cs" />
|
||||||
<Compile Include="CardsController.cs" />
|
<Compile Include="CardsController.cs" />
|
||||||
|
<Compile Include="Configuration.cs" />
|
||||||
<Compile Include="JsonpFormatter.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_Get.cs" />
|
||||||
<Compile Include="RestService_Post.cs" />
|
<Compile Include="RestService_Post.cs" />
|
||||||
<Compile Include="Service1.cs">
|
<Compile Include="Service1.cs">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user