Documentation Coverage Report
Current view: top level - Ninject/Cqrs.Ninject/Configuration - SimplifiedSqlModule.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 Cqrs.Snapshots;
      12             : using Ninject.Modules;
      13             : 
      14             : namespace Cqrs.Ninject.Configuration
      15             : {
      16             :         /// <summary>
      17             :         /// The <see cref="INinjectModule"/> to wireup <see cref="IEvent{TAuthenticationToken}"/> to <see cref="SqlEventStore{TAuthenticationToken}"/>.
      18             :         /// </summary>
      19             :         /// <typeparam name="TAuthenticationToken">The <see cref="Type"/> of the authentication token.</typeparam>
      20             :         public class SimplifiedSqlModule<TAuthenticationToken> : ResolvableModule
      21           1 :         {
      22             :                 #region Overrides of NinjectModule
      23             : 
      24             :                 /// <summary>
      25             :                 /// Loads the module into the kernel.
      26             :                 /// </summary>
      27           1 :                 public override void Load()
      28             :                 {
      29             :                         RegisterEventSerialisationConfiguration();
      30             :                         RegisterEventStore();
      31             :                 }
      32             : 
      33             :                 #endregion
      34             : 
      35             :                 /// <summary>
      36             :                 /// Register the all event serialisation configurations
      37             :                 /// </summary>
      38           1 :                 public virtual void RegisterEventSerialisationConfiguration()
      39             :                 {
      40             :                         Bind<IEventBuilder<TAuthenticationToken>>()
      41             :                                 .To<DefaultEventBuilder<TAuthenticationToken>>()
      42             :                                 .InSingletonScope();
      43             :                         Bind<IEventDeserialiser<TAuthenticationToken>>()
      44             :                                 .To<EventDeserialiser<TAuthenticationToken>>()
      45             :                                 .InSingletonScope();
      46             :                         Bind<ISnapshotDeserialiser>()
      47             :                                 .To<SnapshotDeserialiser>()
      48             :                                 .InSingletonScope();
      49             :                 }
      50             : 
      51             :                 /// <summary>
      52             :                 /// Register the <see cref="IEventStore{TAuthenticationToken}"/>
      53             :                 /// </summary>
      54           1 :                 public virtual void RegisterEventStore()
      55             :                 {
      56             :                         Bind<IEventStore<TAuthenticationToken>>()
      57             :                                 .To<SqlEventStore<TAuthenticationToken>>()
      58             :                                 .InSingletonScope();
      59             :                         Bind<ISnapshotStore>()
      60             :                                 .To<SqlSnapshotStore>()
      61             :                                 .InSingletonScope();
      62             :                 }
      63             :         }
      64             : }

Generated by: LCOV version 1.12