Skip to content

Commit 1efd3a5

Browse files
committed
refactor: CosmosDb outbox namespaces and cleanup usings
Consolidate CosmosDb outbox classes under NetEvolve.Pulse.Outbox namespace. Update XML doc references to match new namespace. Refactor CosmosDbOutboxRepository to iterate over item IDs for deletion. Remove unused using directives for cleaner code.
1 parent d9b45d0 commit 1efd3a5

6 files changed

Lines changed: 9 additions & 13 deletions

File tree

src/NetEvolve.Pulse.CosmosDb/CosmosDbExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ namespace NetEvolve.Pulse;
33
using Microsoft.Azure.Cosmos;
44
using Microsoft.Extensions.DependencyInjection;
55
using Microsoft.Extensions.DependencyInjection.Extensions;
6-
using NetEvolve.Pulse.CosmosDb;
76
using NetEvolve.Pulse.Extensibility;
87
using NetEvolve.Pulse.Extensibility.Outbox;
98
using NetEvolve.Pulse.Outbox;

src/NetEvolve.Pulse.CosmosDb/Outbox/CosmosDbOutboxDocument.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace NetEvolve.Pulse.CosmosDb;
1+
namespace NetEvolve.Pulse.Outbox;
22

33
using System.Text.Json.Serialization;
44
using NetEvolve.Pulse.Extensibility.Outbox;

src/NetEvolve.Pulse.CosmosDb/Outbox/CosmosDbOutboxManagement.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace NetEvolve.Pulse.CosmosDb;
1+
namespace NetEvolve.Pulse.Outbox;
22

33
using System.Collections.Generic;
44
using System.Diagnostics.CodeAnalysis;

src/NetEvolve.Pulse.CosmosDb/Outbox/CosmosDbOutboxOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace NetEvolve.Pulse.CosmosDb;
1+
namespace NetEvolve.Pulse.Outbox;
22

33
/// <summary>
44
/// Configuration options for the Azure Cosmos DB outbox repository.
@@ -52,8 +52,8 @@ public sealed class CosmosDbOutboxOptions
5252
/// </summary>
5353
/// <remarks>
5454
/// When <see langword="true"/>, the <c>ttl</c> property is set to <see cref="TtlSeconds"/>
55-
/// on documents that transition to <see cref="NetEvolve.Pulse.Extensibility.Outbox.OutboxMessageStatus.Completed"/>
56-
/// or <see cref="NetEvolve.Pulse.Extensibility.Outbox.OutboxMessageStatus.DeadLetter"/> status,
55+
/// on documents that transition to <see cref="Extensibility.Outbox.OutboxMessageStatus.Completed"/>
56+
/// or <see cref="Extensibility.Outbox.OutboxMessageStatus.DeadLetter"/> status,
5757
/// enabling automatic cleanup by the Cosmos DB TTL engine.
5858
/// The container must have TTL enabled (DefaultTimeToLive set) for this to take effect.
5959
/// </remarks>

src/NetEvolve.Pulse.CosmosDb/Outbox/CosmosDbOutboxRepository.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
namespace NetEvolve.Pulse.CosmosDb;
1+
namespace NetEvolve.Pulse.Outbox;
22

33
using System.Collections.Generic;
44
using System.Diagnostics.CodeAnalysis;
55
using System.Net;
6-
using System.Runtime.CompilerServices;
76
using Microsoft.Azure.Cosmos;
87
using Microsoft.Extensions.Options;
98
using NetEvolve.Pulse.Extensibility.Outbox;
@@ -260,14 +259,14 @@ public async Task<int> DeleteCompletedAsync(TimeSpan olderThan, CancellationToke
260259
{
261260
var page = await iterator.ReadNextAsync(cancellationToken).ConfigureAwait(false);
262261

263-
foreach (var item in page)
262+
foreach (var itemId in page.Select(x => x.Id))
264263
{
265264
try
266265
{
267266
_ = await _container
268267
.DeleteItemAsync<CosmosDbOutboxDocument>(
269-
item.Id,
270-
new PartitionKey(item.Id),
268+
itemId,
269+
new PartitionKey(itemId),
271270
cancellationToken: cancellationToken
272271
)
273272
.ConfigureAwait(false);

src/NetEvolve.Pulse.Redis/RedisIdempotencyMediatorBuilderExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
namespace NetEvolve.Pulse;
22

33
using System;
4-
using Microsoft.Extensions.Configuration;
54
using Microsoft.Extensions.DependencyInjection;
65
using Microsoft.Extensions.DependencyInjection.Extensions;
7-
using Microsoft.Extensions.Options;
86
using NetEvolve.Pulse.Extensibility;
97
using NetEvolve.Pulse.Extensibility.Idempotency;
108
using NetEvolve.Pulse.Idempotency;

0 commit comments

Comments
 (0)