Documentation Coverage Report
Current view: top level - Ninject/Azure/Cqrs.Ninject.Azure.DocumentDb/Configuration - AzureDocumentDbModule.cs Hit Total Coverage
Version: 2.2 Artefacts: 6 6 100.0 %
Date: 2017-09-22

          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.Linq;
      10             : using Cqrs.Azure.DocumentDb;
      11             : using Cqrs.Azure.DocumentDb.Factories;
      12             : using Ninject.Modules;
      13             : 
      14             : namespace Cqrs.Ninject.Azure.DocumentDb.Configuration
      15             : {
      16             :         /// <summary>
      17             :         /// A <see cref="INinjectModule"/> that wires up <see cref="AzureDocumentDbDataStoreConnectionStringFactory"/> as the <see cref="IAzureDocumentDbDataStoreConnectionStringFactory"/>.
      18             :         /// </summary>
      19             :         public class AzureDocumentDbModule : NinjectModule
      20           1 :         {
      21             :                 #region Overrides of NinjectModule
      22             : 
      23             :                 /// <summary>
      24             :                 /// Loads the module into the kernel.
      25             :                 /// </summary>
      26           1 :                 public override void Load()
      27             :                 {
      28             :                         RegisterFactories();
      29             :                         RegisterServices();
      30             :                         RegisterCqrsRequirements();
      31             :                         RegisterAzureHelpers();
      32             :                 }
      33             : 
      34             :                 #endregion
      35             : 
      36             :                 /// <summary>
      37             :                 /// Register the all factories
      38             :                 /// </summary>
      39           1 :                 public virtual void RegisterFactories()
      40             :                 {
      41             :                         Bind<IAzureDocumentDbDataStoreConnectionStringFactory>()
      42             :                                 .To<AzureDocumentDbDataStoreConnectionStringFactory>()
      43             :                                 .InSingletonScope();
      44             :                 }
      45             : 
      46             :                 /// <summary>
      47             :                 /// Register the all services
      48             :                 /// </summary>
      49           1 :                 public virtual void RegisterServices()
      50             :                 {
      51             :                 }
      52             : 
      53             :                 /// <summary>
      54             :                 /// Register any CQRS requirements.
      55             :                 /// </summary>
      56           1 :                 public virtual void RegisterCqrsRequirements()
      57             :                 {
      58             :                 }
      59             : 
      60             :                 /// <summary>
      61             :                 /// Register <see cref="IAzureDocumentDbHelper"/> if it hasn't already been registered.
      62             :                 /// </summary>
      63           1 :                 public virtual void RegisterAzureHelpers()
      64             :                 {
      65             :                         if (!Kernel.GetBindings(typeof(IAzureDocumentDbHelper)).Any())
      66             :                         {
      67             :                                 Bind<IAzureDocumentDbHelper>()
      68             :                                         .To<AzureDocumentDbHelper>()
      69             :                                         .InSingletonScope();
      70             :                         }
      71             :                 }
      72             :         }
      73             : }

Generated by: LCOV version 1.10