Documentation Coverage Report
Current view: top level - Ninject/Cqrs.Ninject/Configuration - MemoryCacheEventStoreModule.cs Hit Total Coverage
Version: 2.2 Artefacts: 4 4 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 Cqrs.Events;
      11             : using Ninject.Modules;
      12             : 
      13             : namespace Cqrs.Ninject.Configuration
      14             : {
      15             :         /// <summary>
      16             :         /// The <see cref="INinjectModule"/> for use with the Cqrs package.
      17             :         /// </summary>
      18             :         /// <typeparam name="TAuthenticationToken">The <see cref="Type"/> of the authentication token.</typeparam>
      19             :         public class MemoryCacheEventStoreModule<TAuthenticationToken> : ResolvableModule
      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             :                         RegisterEventSerialisationConfiguration();
      29             :                         RegisterEventStore();
      30             :                 }
      31             : 
      32             :                 #endregion
      33             : 
      34             :                 /// <summary>
      35             :                 /// Register the all event serialisation configurations
      36             :                 /// </summary>
      37           1 :                 public virtual void RegisterEventSerialisationConfiguration()
      38             :                 {
      39             :                         Bind<IEventBuilder<TAuthenticationToken>>()
      40             :                                 .To<DefaultEventBuilder<TAuthenticationToken>>()
      41             :                                 .InSingletonScope();
      42             :                         Bind<IEventDeserialiser<TAuthenticationToken>>()
      43             :                                 .To<EventDeserialiser<TAuthenticationToken>>()
      44             :                                 .InSingletonScope();
      45             :                 }
      46             : 
      47             :                 /// <summary>
      48             :                 /// Register the <see cref="IEventStore{TAuthenticationToken}"/>
      49             :                 /// </summary>
      50           1 :                 public virtual void RegisterEventStore()
      51             :                 {
      52             :                         Bind<IEventStore<TAuthenticationToken>>()
      53             :                                 .To<MemoryCacheEventStore<TAuthenticationToken>>()
      54             :                                 .InSingletonScope();
      55             :                 }
      56             :         }
      57             : }

Generated by: LCOV version 1.12