Skip to content

Commit

Permalink
Namespaces fixed. FIles organized
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinRyazantsev committed Apr 11, 2020
1 parent 7fed4bb commit 6387ca8
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 28 deletions.
18 changes: 18 additions & 0 deletions src/Swisschain.Extensions.Idempotency/DefaultOutboxRepository.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Threading.Tasks;

namespace Swisschain.Extensions.Idempotency
{
internal sealed class DefaultOutboxRepository : IOutboxRepository
{
public Task<Outbox> Open(string requestId, Func<Task<long>> aggregateIdFactory)
{
throw new InvalidOperationException("Outbox repository is not configured. To use outbox, you need to configure repository in service.AddOutbox(c => {...})");
}

public Task Save(Outbox outbox, OutboxPersistingReason reason)
{
throw new InvalidOperationException("Outbox repository is not configured. To use outbox, you need to configure repository in service.AddOutbox(c => {...})");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Microsoft.Extensions.DependencyInjection;

namespace Swisschain.Extensions.Idempotency
{
public sealed class OutboxConfigurationBuilder
{
internal OutboxConfigurationBuilder(IServiceCollection services)
{
Services = services;
}

public IServiceCollection Services { get; }
}
}
4 changes: 2 additions & 2 deletions src/Swisschain.Extensions.Idempotency/OutboxManager.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;

namespace Swisschain.Extensions.Idempotency.Outbox
namespace Swisschain.Extensions.Idempotency
{
internal sealed class OutboxManager : IOutboxManager
{
Expand Down Expand Up @@ -65,4 +65,4 @@ public async Task EnsureDispatched(Outbox outbox, IOutboxDispatcher dispatcher)
await _repository.Save(outbox, OutboxPersistingReason.Dispatching);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Swisschain.Extensions.Idempotency.Outbox
namespace Swisschain.Extensions.Idempotency
{
public enum OutboxPersistingReason
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;

namespace Swisschain.Extensions.Idempotency
Expand All @@ -24,28 +23,4 @@ public static IServiceCollection AddOutbox(this IServiceCollection services, Act
return services;
}
}

internal sealed class DefaultOutboxRepository : IOutboxRepository
{
public Task<Outbox> Open(string requestId, Func<Task<long>> aggregateIdFactory)
{
throw new InvalidOperationException("Outbox repository is not configured. To use outbox, you need to configure repository in service.AddOutbox(c => {...})");
}

public Task Save(Outbox outbox, OutboxPersistingReason reason)
{
throw new InvalidOperationException("Outbox repository is not configured. To use outbox, you need to configure repository in service.AddOutbox(c => {...})");
}
}


public sealed class OutboxConfigurationBuilder
{
internal OutboxConfigurationBuilder(IServiceCollection services)
{
Services = services;
}

public IServiceCollection Services { get; }
}
}

0 comments on commit 6387ca8

Please sign in to comment.