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 Cqrs.Configuration;
10 : using cdmdotnet.Logging;
11 :
12 : namespace Cqrs.Azure.Storage.DataStores
13 : {
14 : public class TableStorageDataStoreConnectionStringFactory<TData> : BlobStorage.DataStores.TableStorageDataStoreConnectionStringFactory
15 0 : {
16 0 : public TableStorageDataStoreConnectionStringFactory(IConfigurationManager configurationManager, ILogger logger)
17 : : base(configurationManager, logger)
18 : {
19 : }
20 :
21 : #region Overrides of TableStorageDataStoreConnectionStringFactory
22 :
23 0 : public override string GetContainerName()
24 : {
25 : return GetTableName<TData>();
26 : }
27 :
28 : /// <remarks>https://blogs.msdn.microsoft.com/jmstall/2014/06/12/azure-storage-naming-rules/</remarks>
29 1 : public override string GetTableName<TData1>()
30 : {
31 : string tableName = base.GetTableName<TData>();
32 : if (tableName.Length > 34)
33 : tableName = tableName.Substring(tableName.Length - 34);
34 : return string.Format("{0}V2", tableName);
35 : }
36 :
37 : #endregion
38 : }
39 : }
|