diff --git a/queue/src/fiskaltrust.Middleware.Storage.AzureTableStorage/Repositories/AzureTableStorageQueueItemRepository.cs b/queue/src/fiskaltrust.Middleware.Storage.AzureTableStorage/Repositories/AzureTableStorageQueueItemRepository.cs index 73c509edb..db260e282 100644 --- a/queue/src/fiskaltrust.Middleware.Storage.AzureTableStorage/Repositories/AzureTableStorageQueueItemRepository.cs +++ b/queue/src/fiskaltrust.Middleware.Storage.AzureTableStorage/Repositories/AzureTableStorageQueueItemRepository.cs @@ -210,7 +210,7 @@ public async Task CountAsync() public async Task GetLastQueueItemAsync() { var result = _tableClient.QueryAsync(select: new string[] { "PartitionKey", "RowKey" }); - var lastEntity = await result.LastAsync(); + var lastEntity = await result.FirstAsync(); return MapToStorageEntity(await _tableClient.GetEntityAsync(lastEntity.PartitionKey, lastEntity.RowKey)); }