Skip to content

Commit 527b39e

Browse files
committed
Always use SingleAggregateReadStoreManager with ordered events
1 parent d6a0d1f commit 527b39e

13 files changed

Lines changed: 363 additions & 373 deletions

File tree

Source/EventFlow.Elasticsearch.Tests/IntegrationTests/ElasticsearchReadModelStoreTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// The MIT License (MIT)
22
//
3-
// Copyright (c) 2015-2018 Rasmus Mikkelsen
4-
// Copyright (c) 2015-2018 eBay Software Foundation
3+
// Copyright (c) 2015-2020 Rasmus Mikkelsen
4+
// Copyright (c) 2015-2020 eBay Software Foundation
55
// https://github.com/eventflow/EventFlow
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -67,7 +67,7 @@ protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowO
6767
var resolver = eventFlowOptions
6868
.RegisterServices(sr => { sr.RegisterType(typeof(ThingyMessageLocator)); })
6969
.ConfigureElasticsearch(connectionSettings)
70-
.UseElasticsearchReadModelFor<ThingyAggregate, ThingyId, ElasticsearchThingyReadModel>()
70+
.UseElasticsearchReadModel<ElasticsearchThingyReadModel>()
7171
.UseElasticsearchReadModel<ElasticsearchThingyMessageReadModel, ThingyMessageLocator>()
7272
.AddQueryHandlers(
7373
typeof(ElasticsearchThingyGetQueryHandler),

Source/EventFlow.Elasticsearch/Extensions/EventFlowOptionsExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// The MIT License (MIT)
22
//
3-
// Copyright (c) 2015-2018 Rasmus Mikkelsen
4-
// Copyright (c) 2015-2018 eBay Software Foundation
3+
// Copyright (c) 2015-2020 Rasmus Mikkelsen
4+
// Copyright (c) 2015-2020 eBay Software Foundation
55
// https://github.com/eventflow/EventFlow
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -95,6 +95,7 @@ public static IEventFlowOptions UseElasticsearchReadModel<TReadModel, TReadModel
9595
.UseReadStoreFor<IElasticsearchReadModelStore<TReadModel>, TReadModel, TReadModelLocator>();
9696
}
9797

98+
[Obsolete("Use the simpler method UseElasticsearchReadModel<TReadModel> instead.")]
9899
public static IEventFlowOptions UseElasticsearchReadModelFor<TAggregate, TIdentity, TReadModel>(
99100
this IEventFlowOptions eventFlowOptions)
100101
where TAggregate : IAggregateRoot<TIdentity>

Source/EventFlow.MsSql.Tests/IntegrationTests/ReadStores/MsSqlReadModelStoreTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// The MIT License (MIT)
22
//
3-
// Copyright (c) 2015-2018 Rasmus Mikkelsen
4-
// Copyright (c) 2015-2018 eBay Software Foundation
3+
// Copyright (c) 2015-2020 Rasmus Mikkelsen
4+
// Copyright (c) 2015-2020 eBay Software Foundation
55
// https://github.com/eventflow/EventFlow
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -51,7 +51,7 @@ protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowO
5151
var resolver = eventFlowOptions
5252
.RegisterServices(sr => sr.RegisterType(typeof(ThingyMessageLocator)))
5353
.ConfigureMsSql(MsSqlConfiguration.New.SetConnectionString(_testDatabase.ConnectionString.Value))
54-
.UseMssqlReadModelFor<ThingyAggregate, ThingyId, MsSqlThingyReadModel>()
54+
.UseMssqlReadModel<MsSqlThingyReadModel>()
5555
.UseMssqlReadModel<MsSqlThingyMessageReadModel, ThingyMessageLocator>()
5656
.AddQueryHandlers(
5757
typeof(MsSqlThingyGetQueryHandler),

Source/EventFlow.MsSql/Extensions/EventFlowOptionsMsSqlReadStoreExtensions.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// The MIT License (MIT)
22
//
3-
// Copyright (c) 2015-2018 Rasmus Mikkelsen
4-
// Copyright (c) 2015-2018 eBay Software Foundation
3+
// Copyright (c) 2015-2020 Rasmus Mikkelsen
4+
// Copyright (c) 2015-2020 eBay Software Foundation
55
// https://github.com/eventflow/EventFlow
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -21,6 +21,7 @@
2121
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2222
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2323

24+
using System;
2425
using EventFlow.Aggregates;
2526
using EventFlow.Configuration;
2627
using EventFlow.Core;
@@ -52,6 +53,7 @@ public static IEventFlowOptions UseMssqlReadModel<TReadModel>(
5253
.UseReadStoreFor<IMssqlReadModelStore<TReadModel>, TReadModel>();
5354
}
5455

56+
[Obsolete("Use the simpler method UseMssqlReadModel<TReadModel> instead.")]
5557
public static IEventFlowOptions UseMssqlReadModelFor<TAggregate, TIdentity, TReadModel>(
5658
this IEventFlowOptions eventFlowOptions)
5759
where TAggregate : IAggregateRoot<TIdentity>

Source/EventFlow.SQLite.Tests/IntegrationTests/ReadStores/SQLiteReadStoreTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// The MIT License (MIT)
22
//
3-
// Copyright (c) 2015-2018 Rasmus Mikkelsen
4-
// Copyright (c) 2015-2018 eBay Software Foundation
3+
// Copyright (c) 2015-2020 Rasmus Mikkelsen
4+
// Copyright (c) 2015-2020 eBay Software Foundation
55
// https://github.com/eventflow/EventFlow
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -55,7 +55,7 @@ protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowO
5555
var resolver = eventFlowOptions
5656
.RegisterServices(sr => sr.RegisterType(typeof(ThingyMessageLocator)))
5757
.ConfigureSQLite(SQLiteConfiguration.New.SetConnectionString($"Data Source={_databasePath};Version=3;"))
58-
.UseSQLiteReadModelFor<ThingyAggregate, ThingyId, SQLiteThingyReadModel>()
58+
.UseSQLiteReadModel<SQLiteThingyReadModel>()
5959
.UseSQLiteReadModel<SQLiteThingyMessageReadModel, ThingyMessageLocator>()
6060
.AddQueryHandlers(
6161
typeof(SQLiteThingyGetQueryHandler),

Source/EventFlow.SQLite/Extensions/EventFlowOptionsExtensions.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// The MIT License (MIT)
22
//
3-
// Copyright (c) 2015-2018 Rasmus Mikkelsen
4-
// Copyright (c) 2015-2018 eBay Software Foundation
3+
// Copyright (c) 2015-2020 Rasmus Mikkelsen
4+
// Copyright (c) 2015-2020 eBay Software Foundation
55
// https://github.com/eventflow/EventFlow
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -21,6 +21,7 @@
2121
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2222
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2323

24+
using System;
2425
using EventFlow.Aggregates;
2526
using EventFlow.Configuration;
2627
using EventFlow.Core;
@@ -76,6 +77,7 @@ public static IEventFlowOptions UseSQLiteReadModel<TReadModel>(
7677
.UseReadStoreFor<ISQLiteReadModelStore<TReadModel>, TReadModel>();
7778
}
7879

80+
[Obsolete("Use the simpler method UseSQLiteReadModel<TReadModel> instead.")]
7981
public static IEventFlowOptions UseSQLiteReadModelFor<TAggregate, TIdentity, TReadModel>(
8082
this IEventFlowOptions eventFlowOptions)
8183
where TAggregate : IAggregateRoot<TIdentity>

Source/EventFlow.Tests/IntegrationTests/ReadStores/InMemoryReadModelStoreTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// The MIT License (MIT)
22
//
3-
// Copyright (c) 2015-2018 Rasmus Mikkelsen
4-
// Copyright (c) 2015-2018 eBay Software Foundation
3+
// Copyright (c) 2015-2020 Rasmus Mikkelsen
4+
// Copyright (c) 2015-2020 eBay Software Foundation
55
// https://github.com/eventflow/EventFlow
66
//
77
// Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -44,7 +44,7 @@ protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowO
4444
{
4545
var resolver = eventFlowOptions
4646
.RegisterServices(sr => sr.RegisterType(typeof(ThingyMessageLocator)))
47-
.UseInMemoryReadStoreFor<ThingyAggregate, ThingyId, InMemoryThingyReadModel>()
47+
.UseInMemoryReadStoreFor<InMemoryThingyReadModel>()
4848
.UseInMemoryReadStoreFor<InMemoryThingyMessageReadModel, ThingyMessageLocator>()
4949
.AddQueryHandlers(
5050
typeof(InMemoryThingyGetQueryHandler),

Source/EventFlow.Tests/UnitTests/ReadStores/AggregateReadStoreManagerTests.cs

Lines changed: 0 additions & 198 deletions
This file was deleted.

0 commit comments

Comments
 (0)