-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* EventStore options builder * renamed AddExtension * docs Co-authored-by: Radu Popovici <[email protected]>
- Loading branch information
1 parent
c7af16c
commit f68bc7e
Showing
40 changed files
with
431 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
}, | ||
"EventStore": { | ||
"NBB": { | ||
"TopicSufix": "ProcessMananger" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
src/EventStore/NBB.EventStore.Abstractions/EventStoreEnvelope.cs
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/EventStore/NBB.EventStore.Abstractions/EventStoreOptions.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 23 additions & 12 deletions
35
src/EventStore/NBB.EventStore.AdoNet.Multitenancy/DependencyInjectionExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,33 @@ | ||
// Copyright (c) TotalSoft. | ||
// This source code is licensed under the MIT license. | ||
|
||
using Microsoft.Extensions.Configuration; | ||
using NBB.EventStore; | ||
using NBB.EventStore.AdoNet; | ||
using NBB.EventStore.AdoNet.Multitenancy; | ||
using NBB.EventStore.AdoNet.Multitenancy.Internal; | ||
using NBB.MultiTenancy.Abstractions.Configuration; | ||
using System; | ||
|
||
// ReSharper disable once CheckNamespace | ||
namespace Microsoft.Extensions.DependencyInjection; | ||
|
||
public static class MultiTenantEventStoreAdoNetBuilderExtensions | ||
{ | ||
public static EventStoreAdoNetOptionsBuilder FromTenantConfiguration(this EventStoreAdoNetOptionsBuilder b, string name) | ||
=> b.From<ITenantConfiguration>((c, o) => o.ConnectionString = c.GetConnectionString(name)); | ||
} | ||
|
||
// ReSharper disable once CheckNamespace | ||
namespace Microsoft.Extensions.DependencyInjection | ||
public static class MultiTenantAdoNetEventStoreOptionsBuilderExtensions | ||
{ | ||
public static class DependencyInjectionExtensions | ||
{ | ||
public static IServiceCollection WithMultiTenantAdoNetEventRepository(this IServiceCollection services) | ||
{ | ||
services.AddSingleton<IEventRepository, AdoNetMultiTenantEventRepository>(); | ||
services.AddSingleton<ISnapshotRepository, AdoNetMultitenantSnapshotRepository>(); | ||
services.AddSingleton<NBB.EventStore.AdoNet.Internal.Scripts, Scripts>(); | ||
public static EventStoreOptionsBuilder UseMultiTenantAdoNetEventRepository(this EventStoreOptionsBuilder b, Action<EventStoreAdoNetOptionsBuilder> optionsAction) => ((IEventStoreOptionsBuilder)b).AdExtension(services => | ||
{ | ||
services.AddScoped<IEventRepository, AdoNetMultiTenantEventRepository>(); | ||
services.AddScoped<ISnapshotRepository, AdoNetMultitenantSnapshotRepository>(); | ||
services.AddSingleton<NBB.EventStore.AdoNet.Internal.Scripts, Scripts>(); | ||
|
||
return services; | ||
} | ||
} | ||
var b = new EventStoreAdoNetOptionsBuilder(); | ||
optionsAction?.Invoke(b); | ||
services.AddOptions<EventStoreAdoNetOptions>().Configure<IServiceProvider>(((IEventStoreAdoNetOptionsBuilder)b).Configure); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.