Documentation Coverage Report
Current view: top level - Ninject/Cqrs.Ninject.EventStore/Configuration - EventStoreModule.cs Hit Total Coverage
Version: 2.2 Artefacts: 5 5 100.0 %
Date: 2017-09-22

          Line data    Source code
       1             : using System;
       2             : using Cqrs.EventStore;
       3             : using Cqrs.Events;
       4             : using Ninject.Modules;
       5             : 
       6             : namespace Cqrs.Ninject.Configuration
       7             : {
       8             :         /// <summary>
       9             :         /// A <see cref="INinjectModule"/> that wires up <see cref="EventStore.EventStore{TAuthenticationToken}"/> as the <see cref="IEventStore{TAuthenticationToken}"/>.
      10             :         /// </summary>
      11             :         /// <typeparam name="TAuthenticationToken">The <see cref="Type"/> of the authentication token.</typeparam>
      12             :         public class EventStoreModule<TAuthenticationToken> : NinjectModule
      13           1 :         {
      14             :                 #region Overrides of NinjectModule
      15             : 
      16             :                 /// <summary>
      17             :                 /// Loads the module into the kernel.
      18             :                 /// </summary>
      19           1 :                 public override void Load()
      20             :                 {
      21             :                         RegisterFactories();
      22             :                         RegisterServices();
      23             :                         RegisterCqrsRequirements();
      24             :                 }
      25             : 
      26             :                 #endregion
      27             : 
      28             :                 /// <summary>
      29             :                 /// Register the all factories
      30             :                 /// </summary>
      31           1 :                 public virtual void RegisterFactories()
      32             :                 {
      33             :                         Bind<EventStore.IEventBuilder<TAuthenticationToken>>()
      34             :                                 .To<EventFactory<TAuthenticationToken>>()
      35             :                                 .InSingletonScope();
      36             :                         Bind<EventStore.IEventDeserialiser<TAuthenticationToken>>()
      37             :                                 .To<EventFactory<TAuthenticationToken>>()
      38             :                                 .InSingletonScope();
      39             :                 }
      40             : 
      41             :                 /// <summary>
      42             :                 /// Register the all services
      43             :                 /// </summary>
      44           1 :                 public virtual void RegisterServices()
      45             :                 {
      46             :                 }
      47             : 
      48             :                 /// <summary>
      49             :                 /// Register the <see cref="IEventStoreConnectionHelper"/> and <see cref="IEventStore{TAuthenticationToken}"/>.
      50             :                 /// </summary>
      51           1 :                 public virtual void RegisterCqrsRequirements()
      52             :                 {
      53             :                         Bind<IEventStoreConnectionHelper>()
      54             :                                 .To<EventStoreConnectionHelper<TAuthenticationToken>>()
      55             :                                 .InSingletonScope();
      56             : 
      57             :                         Bind<IEventStore<TAuthenticationToken>>()
      58             :                                 .To<EventStore.EventStore<TAuthenticationToken>>()
      59             :                                 .InSingletonScope();
      60             :                 }
      61             :         }
      62             : }

Generated by: LCOV version 1.10