@@ -25,7 +25,7 @@ partial class TableRepository<T> : ITableRepository<T> where T : class
2525 readonly CloudStorageAccount storageAccount ;
2626 readonly Func < T , string > partitionKey ;
2727 readonly Func < T , string > rowKey ;
28- readonly AsyncLazy < CloudTable > table ;
28+ readonly Task < CloudTable > table ;
2929
3030 /// <summary>
3131 /// Initializes the table repository.
@@ -40,7 +40,7 @@ protected internal TableRepository(CloudStorageAccount storageAccount, string ta
4040 TableName = tableName ?? TableRepository . GetDefaultTableName < T > ( ) ;
4141 this . partitionKey = partitionKey ?? PartitionKeyAttribute . CreateAccessor < T > ( ) ;
4242 this . rowKey = rowKey ?? RowKeyAttribute . CreateAccessor < T > ( ) ;
43- table = new AsyncLazy < CloudTable > ( ( ) => GetTableAsync ( TableName ) ) ;
43+ table = GetTableAsync ( TableName ) ;
4444 }
4545
4646 /// <inheritdoc />
@@ -49,7 +49,7 @@ protected internal TableRepository(CloudStorageAccount storageAccount, string ta
4949 /// <inheritdoc />
5050 public async Task DeleteAsync ( string partitionKey , string rowKey , CancellationToken cancellation = default )
5151 {
52- var table = await this . table . Value . ConfigureAwait ( false ) ;
52+ var table = await this . table . ConfigureAwait ( false ) ;
5353
5454 await table . ExecuteAsync ( TableOperation . Delete (
5555 new TableEntity ( partitionKey , rowKey ) { ETag = "*" } ) , cancellation )
@@ -61,7 +61,7 @@ public async Task DeleteAsync(T entity, CancellationToken cancellation = default
6161 {
6262 var partitionKey = this . partitionKey . Invoke ( entity ) ;
6363 var rowKey = this . rowKey . Invoke ( entity ) ;
64- var table = await this . table . Value . ConfigureAwait ( false ) ;
64+ var table = await this . table . ConfigureAwait ( false ) ;
6565
6666 await table . ExecuteAsync ( TableOperation . Delete (
6767 new TableEntity ( partitionKey , rowKey ) { ETag = "*" } ) , cancellation )
@@ -71,7 +71,7 @@ await table.ExecuteAsync(TableOperation.Delete(
7171 /// <inheritdoc />
7272 public async IAsyncEnumerable < T > EnumerateAsync ( string partitionKey , [ EnumeratorCancellation ] CancellationToken cancellation = default )
7373 {
74- var table = await this . table . Value ;
74+ var table = await this . table ;
7575 var query = new TableQuery < DynamicTableEntity > ( )
7676 . Where ( TableQuery . GenerateFilterCondition ( "PartitionKey" , QueryComparisons . Equal , partitionKey ) ) ;
7777
@@ -91,7 +91,7 @@ public async IAsyncEnumerable<T> EnumerateAsync(string partitionKey, [Enumerator
9191 /// <inheritdoc />
9292 public async Task < T ? > GetAsync ( string partitionKey , string rowKey , CancellationToken cancellation = default )
9393 {
94- var table = await this . table . Value . ConfigureAwait ( false ) ;
94+ var table = await this . table . ConfigureAwait ( false ) ;
9595 var result = await table . ExecuteAsync ( TableOperation . Retrieve ( partitionKey , rowKey ) , cancellation )
9696 . ConfigureAwait ( false ) ;
9797
@@ -111,7 +111,7 @@ public async Task<T> PutAsync(T entity, CancellationToken cancellation = default
111111 . Where ( prop => prop . GetCustomAttribute < BrowsableAttribute > ( ) ? . Browsable != false )
112112 . ToArray ( ) ) ;
113113
114- var table = await this . table . Value . ConfigureAwait ( false ) ;
114+ var table = await this . table . ConfigureAwait ( false ) ;
115115 var values = properties
116116 . ToDictionary ( prop => prop . Name , prop => EntityProperty . CreateEntityPropertyFromObject ( prop . GetValue ( entity ) ) ) ;
117117
0 commit comments