Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
petero-dk committed Aug 19, 2024
1 parent f75d805 commit 644e8d2
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions CoreHelpers.WindowsAzure.Storage.Table/StorageContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
namespace CoreHelpers.WindowsAzure.Storage.Table
{
public partial class StorageContext : IStorageContext
{
private IStorageContextDelegate _delegate { get; set; }
private TableServiceClient tableServiceClient { get; set; }
{
private IStorageContextDelegate _delegate { get; set; }
private TableServiceClient tableServiceClient { get; set; }

public StorageContext(string storageAccountName, string storageAccountKey, string storageEndpointSuffix = null)
{
{
if (!String.IsNullOrEmpty(storageEndpointSuffix))
tableServiceClient = new TableServiceClient(string.Format("DefaultEndpointsProtocol={0};AccountName={1};AccountKey={2};EndpointSuffix={3}", "https", storageAccountName, storageAccountKey, storageEndpointSuffix));
else
tableServiceClient = new TableServiceClient(string.Format("DefaultEndpointsProtocol={0};AccountName={1};AccountKey={2}", "https", storageAccountName, storageAccountKey));
}

}

public StorageContext(string connectionString)
{
Expand All @@ -29,41 +29,41 @@ public StorageContext(TableServiceClient tableServiceClient)
}

public StorageContext(StorageContext parentContext)
{
{
// we reference the entity mapper
_entityMapperRegistry = new Dictionary<Type, StorageEntityMapper>(parentContext._entityMapperRegistry);

// we are using the delegate
this.SetDelegate(parentContext._delegate);
this.SetDelegate(parentContext._delegate);

// take the tablename prefix
_tableNamePrefix = parentContext._tableNamePrefix;
// take the tablename prefix
_tableNamePrefix = parentContext._tableNamePrefix;

// store the connection string
tableServiceClient = parentContext.tableServiceClient;
}

public void Dispose()
{}
{ }

public void SetDelegate(IStorageContextDelegate delegateModel)
=> _delegate = delegateModel;

public void SetDelegate(IStorageContextDelegate delegateModel)
=> _delegate = delegateModel;
public IStorageContextDelegate GetDelegate()
=> _delegate;

public IStorageContextDelegate GetDelegate()
=> _delegate;
public IStorageContext CreateChildContext()
=> new StorageContext(this);

public IStorageContext CreateChildContext()
=> new StorageContext(this);

public TableClient GetTableClient<T>()
{
var tableName = GetTableName<T>();
return GetTableClient(tableName);
var tableName = GetTableName<T>();
return GetTableClient(tableName);
}

private TableClient GetTableClient(string tableName)
{
return tableServiceClient.GetTableClient(tableName);
}
return tableServiceClient.GetTableClient(tableName);
}
}
}

0 comments on commit 644e8d2

Please sign in to comment.