|
1 | | -// ========================================================================== |
2 | | -// Squidex Headless CMS |
3 | | -// ========================================================================== |
4 | | -// Copyright (c) Squidex UG (haftungsbeschraenkt) |
5 | | -// All rights reserved. Licensed under the MIT license. |
6 | | -// ========================================================================== |
7 | | - |
8 | | -using Microsoft.Extensions.Configuration; |
9 | | -using Squidex.Events; |
10 | | -using Squidex.Events.EntityFramework; |
11 | | -using Squidex.Events.Mongo; |
12 | | - |
13 | | -namespace Microsoft.Extensions.DependencyInjection; |
14 | | - |
15 | | -public static class EventsServiceExtensions |
16 | | -{ |
17 | | - public static EventStoreBuilder AddMongoEventStore(this IServiceCollection services, IConfiguration config, Action<MongoEventStoreOptions>? configure = null, |
18 | | - string configPath = "eventStore:sql") |
19 | | - { |
20 | | - services.Configure(config, configPath, configure); |
21 | | - |
22 | | - services.AddSingletonAs<MongoEventStore>() |
23 | | - .As<IEventStore>(); |
24 | | - services.AddSingleton(TimeProvider.System); |
25 | | - |
26 | | - return new EventStoreBuilder(services); |
27 | | - } |
28 | | -} |
| 1 | +// ========================================================================== |
| 2 | +// Squidex Headless CMS |
| 3 | +// ========================================================================== |
| 4 | +// Copyright (c) Squidex UG (haftungsbeschraenkt) |
| 5 | +// All rights reserved. Licensed under the MIT license. |
| 6 | +// ========================================================================== |
| 7 | + |
| 8 | +using Microsoft.Extensions.Configuration; |
| 9 | +using Squidex.Events; |
| 10 | +using Squidex.Events.EntityFramework; |
| 11 | +using Squidex.Events.Mongo; |
| 12 | + |
| 13 | +namespace Microsoft.Extensions.DependencyInjection; |
| 14 | + |
| 15 | +public static class EventsServiceExtensions |
| 16 | +{ |
| 17 | + public static EventStoreBuilder AddMongoEventStore(this IServiceCollection services, IConfiguration config, Action<MongoEventStoreOptions>? configure = null, |
| 18 | + string configPath = "eventStore:mongoDb") |
| 19 | + { |
| 20 | + services.Configure(config, configPath, configure); |
| 21 | + |
| 22 | + services.AddSingletonAs<MongoEventStore>() |
| 23 | + .As<IEventStore>(); |
| 24 | + services.AddSingleton(TimeProvider.System); |
| 25 | + |
| 26 | + return new EventStoreBuilder(services); |
| 27 | + } |
| 28 | +} |
0 commit comments