Documentation Coverage Report
Current view: top level - Ninject/Cqrs.Ninject.WebApi/Configuration - WebApiModule.cs Hit Total Coverage
Version: 2.2 Artefacts: 3 3 100.0 %
Date: 2018-08-07 15:04:50

          Line data    Source code
       1             : #region Copyright
       2             : // // -----------------------------------------------------------------------
       3             : // // <copyright company="Chinchilla Software Limited">
       4             : // //   Copyright Chinchilla Software Limited. All rights reserved.
       5             : // // </copyright>
       6             : // // -----------------------------------------------------------------------
       7             : #endregion
       8             : 
       9             : using System;
      10             : using System.Web;
      11             : using Cqrs.Configuration;
      12             : using Cqrs.WebApi.SignalR.Hubs;
      13             : using Ninject;
      14             : using Ninject.Modules;
      15             : using Ninject.Web.Common;
      16             : 
      17             : namespace Cqrs.Ninject.WebApi.Configuration
      18             : {
      19             :         /// <summary>
      20             :         /// A <see cref="INinjectModule"/> that sets up default WebApi.
      21             :         /// </summary>
      22             :         public class WebApiModule : NinjectModule
      23           1 :         {
      24             :                 #region Overrides of NinjectModule
      25             : 
      26             :                 /// <summary>
      27             :                 /// Loads the module into the kernel.
      28             :                 /// </summary>
      29           1 :                 public override void Load()
      30             :                 {
      31             :                         Bind<IConfigurationManager>()
      32             :                                 .To<ConfigurationManager>()
      33             :                                 .InSingletonScope();
      34             : 
      35             :                         RegisterWebApi();
      36             :                 }
      37             : 
      38             :                 #endregion
      39             : 
      40             :                 /// <summary>
      41             :                 /// Register the some WebAPI and SignalR requirements
      42             :                 /// </summary>
      43           1 :                 protected virtual void RegisterWebApi()
      44             :                 {
      45             :                         Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel);
      46             :                         Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();
      47             : 
      48             :                         Bind<INotificationHub>()
      49             :                                 .To<NotificationHub>()
      50             :                                 .InSingletonScope();
      51             :                 }
      52             :         }
      53             : }

Generated by: LCOV version 1.12