Documentation Coverage Report
Current view: top level - Ninject/Azure/Cqrs.Ninject.Azure.BlobStorage/Configuration - TableStoragEventStoreModule.cs Hit Total Coverage
Version: 2.2 Artefacts: 5 5 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.Azure.BlobStorage;
      11             : using Cqrs.Azure.BlobStorage.Events;
      12             : using Cqrs.Events;
      13             : using Cqrs.Snapshots;
      14             : using Ninject.Modules;
      15             : 
      16             : namespace Cqrs.Ninject.Azure.BlobStorage.Configuration
      17             : {
      18             :         /// <summary>
      19             :         /// A <see cref="INinjectModule"/> that wires up the prerequisites of <see cref="IEventStore{TAuthenticationToken}"/> with table storage.
      20             :         /// </summary>
      21             :         /// <typeparam name="TAuthenticationToken">The <see cref="Type"/> of the authentication token.</typeparam>
      22             :         public class TableStoragEventStoreModule<TAuthenticationToken> : 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             :                         RegisterFactories();
      32             :                         RegisterEventSerialisationConfiguration();
      33             :                         RegisterEventStore();
      34             :                 }
      35             : 
      36             :                 #endregion
      37             : 
      38             :                 /// <summary>
      39             :                 /// Register the all factories
      40             :                 /// </summary>
      41           1 :                 public virtual void RegisterFactories()
      42             :                 {
      43             :                         Bind<ITableStorageStoreConnectionStringFactory>()
      44             :                                 .To<TableStorageEventStoreConnectionStringFactory>()
      45             :                                 .InSingletonScope();
      46             :                         Bind<ITableStorageSnapshotStoreConnectionStringFactory>()
      47             :                                 .To<TableStorageSnapshotStoreConnectionStringFactory>()
      48             :                                 .InSingletonScope();
      49             :                 }
      50             : 
      51             :                 /// <summary>
      52             :                 /// Register the all event serialisation configurations
      53             :                 /// </summary>
      54           1 :                 public virtual void RegisterEventSerialisationConfiguration()
      55             :                 {
      56             :                         Bind<IEventBuilder<TAuthenticationToken>>()
      57             :                                 .To<DefaultEventBuilder<TAuthenticationToken>>()
      58             :                                 .InSingletonScope();
      59             :                         Bind<IEventDeserialiser<TAuthenticationToken>>()
      60             :                                 .To<EventDeserialiser<TAuthenticationToken>>()
      61             :                                 .InSingletonScope();
      62             :                         Bind<ISnapshotDeserialiser>()
      63             :                                 .To<SnapshotDeserialiser>()
      64             :                                 .InSingletonScope();
      65             :                 }
      66             : 
      67             :                 /// <summary>
      68             :                 /// Register the <see cref="IEventStore{TAuthenticationToken}"/>
      69             :                 /// </summary>
      70           1 :                 public virtual void RegisterEventStore()
      71             :                 {
      72             :                         /*
      73             :                         Bind<IEventStore<TAuthenticationToken>>()
      74             :                                 .To<TableStorageEventStore<TAuthenticationToken>>()
      75             :                                 .InSingletonScope();
      76             :                         Bind<ISnapshotStore>()
      77             :                                 .To<TableStorageSnapshotStore>()
      78             :                                 .InSingletonScope();
      79             :                         */
      80             :                 }
      81             :         }
      82             : }

Generated by: LCOV version 1.12