LCOV - code coverage report
Current view: top level - Azure/Cqrs.Azure.BlobStorage/DataStores - TableStorageDataStore.cs Hit Total Coverage
Test: doc-coverage.info Lines: 2 6 33.3 %
Date: 2017-07-26

          Line data    Source code
       1             : #region Copyright
       2             : // // -----------------------------------------------------------------------
       3             : // // <copyright company="cdmdotnet Limited">
       4             : // //   Copyright cdmdotnet Limited. All rights reserved.
       5             : // // </copyright>
       6             : // // -----------------------------------------------------------------------
       7             : #endregion
       8             : 
       9             : using cdmdotnet.Logging;
      10             : using Cqrs.Entities;
      11             : using Microsoft.WindowsAzure.Storage.Table;
      12             : 
      13             : namespace Cqrs.Azure.BlobStorage.DataStores
      14             : {
      15             :         public class TableStorageDataStore<TData>
      16             :                 : TableStorageStore<EntityTableEntity<TData>, TData>
      17             :                 where TData : Entity
      18           0 :         {
      19             :                 /// <summary>
      20             :                 /// Initializes a new instance of the <see cref="BlobStorage"/> class using the specified container.
      21             :                 /// </summary>
      22           1 :                 public TableStorageDataStore(ILogger logger, ITableStorageDataStoreConnectionStringFactory tableStorageDataStoreConnectionStringFactory)
      23             :                         : base(logger)
      24             :                 {
      25             :                         GetContainerName = tableStorageDataStoreConnectionStringFactory.GetTableName<TData>;
      26             :                         IsContainerPublic = () => false;
      27             : 
      28             :                         // ReSharper disable DoNotCallOverridableMethodsInConstructor
      29             :                         Initialise(tableStorageDataStoreConnectionStringFactory);
      30             :                         // ReSharper restore DoNotCallOverridableMethodsInConstructor
      31             :                 }
      32             : 
      33             :                 #region Implementation of IDataStore<TData>
      34             : 
      35             :                 /// <summary>
      36             :                 /// Will mark the <paramref name="data"/> as logically (or soft).
      37             :                 /// </summary>
      38           1 :                 public override void Remove(TData data)
      39             :                 {
      40             :                         data.IsLogicallyDeleted = true;
      41             :                         Update(data);
      42             :                 }
      43             : 
      44             :                 #endregion
      45             : 
      46             :                 #region Overrides of TableStorageStore<TData>
      47             : 
      48           0 :                 protected override ITableEntity CreateTableEntity(TData data)
      49             :                 {
      50             :                         return new EntityTableEntity<TData>(data);
      51             :                 }
      52             : 
      53           0 :                 protected override TableOperation GetUpdatableTableEntity(TData data)
      54             :                 {
      55             :                         return TableOperation.Retrieve<EntityTableEntity<TData>>(data.GetType().FullName, data.Rsn.ToString("N"));
      56             :                 }
      57             : 
      58           0 :                 protected override TableOperation GetUpdatableTableEntity(EntityTableEntity<TData> data)
      59             :                 {
      60             :                         return GetUpdatableTableEntity(data.Entity);
      61             :                 }
      62             : 
      63             :                 #endregion
      64             :         }
      65             : }

Generated by: LCOV version 1.10