From 73475fc15cda84e3c91791d705242df0eb1d3c68 Mon Sep 17 00:00:00 2001 From: "oskar.dudycz" Date: Mon, 14 Jun 2021 11:20:59 +0200 Subject: [PATCH] Updated Marten to 4.0.0-rc.2 (together with other dependencies) --- CQRS.Tests/CQRS.Tests.csproj | 4 ++-- Core.Marten/Config.cs | 2 +- Core.Marten/Core.Marten.csproj | 4 ++-- Core.Streaming.Kafka/Core.Streaming.Kafka.csproj | 2 +- Core.Testing/Core.Testing.csproj | 4 ++-- Core.Tests/Core.Tests.csproj | 4 ++-- Core.WebApi/Core.WebApi.csproj | 2 +- .../EventSourcing.Integration.Tests.csproj | 4 ++-- .../EventStore/Aggregate/InlineAggregationStorage.cs | 2 +- .../Aggregate/OutOfOrder/OutOfOrderProjectionsTest.cs | 2 +- .../EventStore/Aggregate/Reaggregation.cs | 2 +- .../Projections/AggregationProjectionsTest.cs | 4 ++-- .../Marten.Integration.Tests.csproj | 4 ++-- MediatR.Tests/MediatR.Tests.csproj | 4 ++-- .../SmartHome.Api/SmartHome.Api.csproj | 2 +- .../MotionSensors/MotionSensorConfig.cs | 2 +- .../SmartHome.Temperature.csproj | 2 +- .../TemperatureSummaryConfig.cs | 2 +- .../EventSourcing.Sample.Clients.Contracts.csproj | 2 +- .../EventSourcing.Sample.Clients.csproj | 8 ++++---- .../EventSourcing.Sample.IntegrationTests.csproj | 6 +++--- ...EventSourcing.Sample.Transactions.Contracts.csproj | 2 +- .../EventSourcing.Sample.Transactions.csproj | 2 +- .../EventSourcing.Sample.Web.csproj | 10 +++++----- .../BankAccounts/EventSourcing.Sample.Web/Startup.cs | 8 ++++---- .../Carts/Carts.Api.Tests/Carts.Api.Tests.csproj | 4 ++-- Sample/ECommerce/Carts/Carts.Api/Carts.Api.csproj | 8 ++++---- Sample/ECommerce/Carts/Carts.Tests/Carts.Tests.csproj | 4 ++-- Sample/ECommerce/Carts/Carts/Carts.csproj | 2 +- Sample/ECommerce/Carts/Carts/Carts/Config.cs | 8 ++++---- .../Orders/Orders.Api.Tests/Orders.Api.Tests.csproj | 4 ++-- Sample/ECommerce/Orders/Orders.Api/Orders.Api.csproj | 10 +++++----- .../ECommerce/Orders/Orders.Tests/Orders.Tests.csproj | 4 ++-- Sample/ECommerce/Orders/Orders/Orders.csproj | 2 +- Sample/ECommerce/Orders/Orders/Orders/Config.cs | 2 +- .../Payments.Api.Tests/Payments.Api.Tests.csproj | 4 ++-- .../Payments/Payments.Api/Payments.Api.csproj | 10 +++++----- .../Payments/Payments.Tests/Payments.Tests.csproj | 4 ++-- Sample/ECommerce/Payments/Payments/Payments.csproj | 2 +- Sample/ECommerce/Payments/Payments/Payments/Config.cs | 2 +- .../Shipments.Api.Tests/Shipments.Api.Tests.csproj | 4 ++-- .../Shipments/Shipments.Api/Shipments.Api.csproj | 8 ++++---- .../Shipments/Shipments.Tests/Shipments.Tests.csproj | 4 ++-- Sample/ECommerce/Shipments/Shipments/Shipments.csproj | 6 +++--- .../MeetingsManagement.Api.csproj | 4 ++-- .../MeetingsManagement.IntegrationTests.csproj | 6 +++--- .../MeetingsManagement/Meetings/Config.cs | 4 ++-- .../MeetingsManagement/MeetingsManagement.csproj | 2 +- .../MeetingsSearch.Api/MeetingsSearch.Api.csproj | 2 +- .../MeetingsSearch.IntegrationTests.csproj | 6 +++--- .../MeetingsSearch/MeetingsSearch.csproj | 2 +- .../Tickets.Api.Tests/Tickets.Api.Tests.csproj | 4 ++-- Sample/Tickets/Tickets.Api/Tickets.Api.csproj | 2 +- Sample/Tickets/Tickets.Tests/Tickets.Tests.csproj | 6 +++--- .../Tickets/Reservations/ReservationsConfig.cs | 8 ++++---- Sample/Tickets/Tickets/Tickets.csproj | 2 +- .../Warehouse.Api.Tests/Warehouse.Api.Tests.csproj | 6 +----- Sample/Warehouse/Warehouse.Api/Warehouse.Api.csproj | 6 +++--- Sample/Warehouse/Warehouse/Configuration.cs | 2 +- Sample/Warehouse/Warehouse/Warehouse.csproj | 6 +++--- .../01-CreateStreamsTable.csproj | 4 ++-- .../02-CreateEventsTable/02-CreateEventsTable.csproj | 4 ++-- .../03-CreateAppendEventFunction.csproj | 4 ++-- .../03-OptimisticConcurrency.csproj | 4 ++-- .../04-EventStoreMethods/04-EventStoreMethods.csproj | 4 ++-- .../05-StreamAggregation/05-StreamAggregation.csproj | 4 ++-- .../06-TimeTraveling/06-TimeTraveling.csproj | 4 ++-- .../07-AggregateAndRepository.csproj | 4 ++-- .../08-Snapshots/08-Snapshots.csproj | 4 ++-- .../09-Projections/09-Projections.csproj | 4 ++-- .../10-ProjectionsWithMarten.csproj | 4 ++-- .../Exercise10ProjectionsWithMarten.cs | 9 +++++---- .../10-ProjectionsWithMarten/IRepository.cs | 2 +- .../10-ProjectionsWithMarten/MartenRepository.cs | 2 +- .../EventStoreBasics.Tests.csproj | 4 ++-- .../Exercise10ProjectionsWithMarten.cs | 11 ++++++----- .../EventStoreBasics/EventStoreBasics.csproj | 2 +- .../EventStoreBasics/MartenRepository.cs | 7 ++++++- Workshops/BuildYourOwnEventStore/Tools/Tools.csproj | 2 +- 79 files changed, 168 insertions(+), 165 deletions(-) diff --git a/CQRS.Tests/CQRS.Tests.csproj b/CQRS.Tests/CQRS.Tests.csproj index 1a1145d69..20477a6cf 100644 --- a/CQRS.Tests/CQRS.Tests.csproj +++ b/CQRS.Tests/CQRS.Tests.csproj @@ -14,8 +14,8 @@ - - + + diff --git a/Core.Marten/Config.cs b/Core.Marten/Config.cs index d3856f2a4..f38b84249 100644 --- a/Core.Marten/Config.cs +++ b/Core.Marten/Config.cs @@ -61,7 +61,7 @@ private static void SetStoreOptions(StoreOptions options, Config config, options.UseDefaultSerialization(nonPublicMembersStorage: NonPublicMembersStorage.NonPublicSetters, enumStorage: EnumStorage.AsString); - options.Events.Daemon.Mode = config.DaemonMode; + options.Projections.AsyncMode = config.DaemonMode; configureOptions?.Invoke(options); } diff --git a/Core.Marten/Core.Marten.csproj b/Core.Marten/Core.Marten.csproj index ea35de4c5..cf4aadfbf 100644 --- a/Core.Marten/Core.Marten.csproj +++ b/Core.Marten/Core.Marten.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/Core.Streaming.Kafka/Core.Streaming.Kafka.csproj b/Core.Streaming.Kafka/Core.Streaming.Kafka.csproj index e990456ed..aece29b7a 100644 --- a/Core.Streaming.Kafka/Core.Streaming.Kafka.csproj +++ b/Core.Streaming.Kafka/Core.Streaming.Kafka.csproj @@ -7,7 +7,7 @@ - + diff --git a/Core.Testing/Core.Testing.csproj b/Core.Testing/Core.Testing.csproj index 608c719b3..d0e268516 100644 --- a/Core.Testing/Core.Testing.csproj +++ b/Core.Testing/Core.Testing.csproj @@ -10,11 +10,11 @@ - + - + diff --git a/Core.Tests/Core.Tests.csproj b/Core.Tests/Core.Tests.csproj index aabcd7477..ee86a08d2 100644 --- a/Core.Tests/Core.Tests.csproj +++ b/Core.Tests/Core.Tests.csproj @@ -18,8 +18,8 @@ - - + + diff --git a/Core.WebApi/Core.WebApi.csproj b/Core.WebApi/Core.WebApi.csproj index f075c4ae5..3d94c2f62 100644 --- a/Core.WebApi/Core.WebApi.csproj +++ b/Core.WebApi/Core.WebApi.csproj @@ -11,7 +11,7 @@ - + diff --git a/EventSourcing.Integration.Tests/EventSourcing.Integration.Tests.csproj b/EventSourcing.Integration.Tests/EventSourcing.Integration.Tests.csproj index 1b765e041..1495a5106 100644 --- a/EventSourcing.Integration.Tests/EventSourcing.Integration.Tests.csproj +++ b/EventSourcing.Integration.Tests/EventSourcing.Integration.Tests.csproj @@ -14,8 +14,8 @@ - - + + diff --git a/Marten.Integration.Tests/EventStore/Aggregate/InlineAggregationStorage.cs b/Marten.Integration.Tests/EventStore/Aggregate/InlineAggregationStorage.cs index 766c45e30..96d41f847 100644 --- a/Marten.Integration.Tests/EventStore/Aggregate/InlineAggregationStorage.cs +++ b/Marten.Integration.Tests/EventStore/Aggregate/InlineAggregationStorage.cs @@ -46,7 +46,7 @@ protected override IDocumentSession CreateSession(Action? storeOpt return base.CreateSession(options => { //It's needed to manually set that inline aggregation should be applied - options.Events.Projections.SelfAggregate(); + options.Projections.SelfAggregate(); }); } diff --git a/Marten.Integration.Tests/EventStore/Aggregate/OutOfOrder/OutOfOrderProjectionsTest.cs b/Marten.Integration.Tests/EventStore/Aggregate/OutOfOrder/OutOfOrderProjectionsTest.cs index 29a4c7254..999a38130 100644 --- a/Marten.Integration.Tests/EventStore/Aggregate/OutOfOrder/OutOfOrderProjectionsTest.cs +++ b/Marten.Integration.Tests/EventStore/Aggregate/OutOfOrder/OutOfOrderProjectionsTest.cs @@ -57,7 +57,7 @@ protected override IDocumentSession CreateSession(Action? setStore options.Events.DatabaseSchemaName = SchemaName; //It's needed to manually set that inline aggregation should be applied - options.Events.Projections.SelfAggregate(); + options.Projections.SelfAggregate(); }); return store.OpenSession(); diff --git a/Marten.Integration.Tests/EventStore/Aggregate/Reaggregation.cs b/Marten.Integration.Tests/EventStore/Aggregate/Reaggregation.cs index ecb1da98d..6e01c0399 100644 --- a/Marten.Integration.Tests/EventStore/Aggregate/Reaggregation.cs +++ b/Marten.Integration.Tests/EventStore/Aggregate/Reaggregation.cs @@ -69,7 +69,7 @@ public Reaggregation() : base(false) { options.Events.AddEventTypes(new[] { typeof(IssueCreated), typeof(IssueUpdated) }); //It's needed to manualy set that inline aggegation should be applied - options.Events.Projections.SelfAggregate(); + options.Projections.SelfAggregate(); }); } diff --git a/Marten.Integration.Tests/EventStore/Projections/AggregationProjectionsTest.cs b/Marten.Integration.Tests/EventStore/Projections/AggregationProjectionsTest.cs index aa53023a4..a4f5e0b40 100644 --- a/Marten.Integration.Tests/EventStore/Projections/AggregationProjectionsTest.cs +++ b/Marten.Integration.Tests/EventStore/Projections/AggregationProjectionsTest.cs @@ -83,8 +83,8 @@ protected override IDocumentSession CreateSession(Action? setStore options.Events.DatabaseSchemaName = SchemaName; //It's needed to manually set that inline aggregation should be applied - options.Events.Projections.SelfAggregate(); - options.Events.Projections.Add(new IssueDescriptionsProjection()); + options.Projections.SelfAggregate(); + options.Projections.Add(new IssueDescriptionsProjection()); }); return store.OpenSession(); diff --git a/Marten.Integration.Tests/Marten.Integration.Tests.csproj b/Marten.Integration.Tests/Marten.Integration.Tests.csproj index 1df9ab692..352692634 100644 --- a/Marten.Integration.Tests/Marten.Integration.Tests.csproj +++ b/Marten.Integration.Tests/Marten.Integration.Tests.csproj @@ -18,9 +18,9 @@ - + - + diff --git a/MediatR.Tests/MediatR.Tests.csproj b/MediatR.Tests/MediatR.Tests.csproj index f2ac95f44..8fc07c7e3 100644 --- a/MediatR.Tests/MediatR.Tests.csproj +++ b/MediatR.Tests/MediatR.Tests.csproj @@ -17,8 +17,8 @@ - - + + diff --git a/Sample/AsyncProjections/SmartHome.Api/SmartHome.Api.csproj b/Sample/AsyncProjections/SmartHome.Api/SmartHome.Api.csproj index 33301b938..82a58311d 100644 --- a/Sample/AsyncProjections/SmartHome.Api/SmartHome.Api.csproj +++ b/Sample/AsyncProjections/SmartHome.Api/SmartHome.Api.csproj @@ -8,7 +8,7 @@ - + diff --git a/Sample/AsyncProjections/SmartHome.Temperature/MotionSensors/MotionSensorConfig.cs b/Sample/AsyncProjections/SmartHome.Temperature/MotionSensors/MotionSensorConfig.cs index 6c103ec90..d92669845 100644 --- a/Sample/AsyncProjections/SmartHome.Temperature/MotionSensors/MotionSensorConfig.cs +++ b/Sample/AsyncProjections/SmartHome.Temperature/MotionSensors/MotionSensorConfig.cs @@ -35,7 +35,7 @@ private static void AddQueryHandlers(IServiceCollection services) internal static void ConfigureMotionSensors(this StoreOptions options) { // Snapshots - options.Events.Projections.SelfAggregate(); + options.Projections.SelfAggregate(); } } } diff --git a/Sample/AsyncProjections/SmartHome.Temperature/SmartHome.Temperature.csproj b/Sample/AsyncProjections/SmartHome.Temperature/SmartHome.Temperature.csproj index 3aa43a244..84fdb1079 100644 --- a/Sample/AsyncProjections/SmartHome.Temperature/SmartHome.Temperature.csproj +++ b/Sample/AsyncProjections/SmartHome.Temperature/SmartHome.Temperature.csproj @@ -13,7 +13,7 @@ - + diff --git a/Sample/AsyncProjections/SmartHome.Temperature/TemperatureMeasurements/TemperatureSummaryConfig.cs b/Sample/AsyncProjections/SmartHome.Temperature/TemperatureMeasurements/TemperatureSummaryConfig.cs index a08f76f8f..71f0711d7 100644 --- a/Sample/AsyncProjections/SmartHome.Temperature/TemperatureMeasurements/TemperatureSummaryConfig.cs +++ b/Sample/AsyncProjections/SmartHome.Temperature/TemperatureMeasurements/TemperatureSummaryConfig.cs @@ -36,7 +36,7 @@ private static void AddQueryHandlers(IServiceCollection services) internal static void ConfigureTemperatureMeasurements(this StoreOptions options) { // Snapshots - options.Events.Projections.SelfAggregate(ProjectionLifecycle.Async); + options.Projections.SelfAggregate(ProjectionLifecycle.Async); } } } diff --git a/Sample/BankAccounts/EventSourcing.Sample.Clients.Contracts/EventSourcing.Sample.Clients.Contracts.csproj b/Sample/BankAccounts/EventSourcing.Sample.Clients.Contracts/EventSourcing.Sample.Clients.Contracts.csproj index e5ed3544d..39609b7c8 100644 --- a/Sample/BankAccounts/EventSourcing.Sample.Clients.Contracts/EventSourcing.Sample.Clients.Contracts.csproj +++ b/Sample/BankAccounts/EventSourcing.Sample.Clients.Contracts/EventSourcing.Sample.Clients.Contracts.csproj @@ -8,7 +8,7 @@ - + diff --git a/Sample/BankAccounts/EventSourcing.Sample.Clients/EventSourcing.Sample.Clients.csproj b/Sample/BankAccounts/EventSourcing.Sample.Clients/EventSourcing.Sample.Clients.csproj index 7a1df3a93..12b4a2c4c 100644 --- a/Sample/BankAccounts/EventSourcing.Sample.Clients/EventSourcing.Sample.Clients.csproj +++ b/Sample/BankAccounts/EventSourcing.Sample.Clients/EventSourcing.Sample.Clients.csproj @@ -12,14 +12,14 @@ - - - + + + all runtime; build; native; contentfiles; analyzers - + diff --git a/Sample/BankAccounts/EventSourcing.Sample.IntegrationTests/EventSourcing.Sample.IntegrationTests.csproj b/Sample/BankAccounts/EventSourcing.Sample.IntegrationTests/EventSourcing.Sample.IntegrationTests.csproj index 2791f10be..85a47aae7 100644 --- a/Sample/BankAccounts/EventSourcing.Sample.IntegrationTests/EventSourcing.Sample.IntegrationTests.csproj +++ b/Sample/BankAccounts/EventSourcing.Sample.IntegrationTests/EventSourcing.Sample.IntegrationTests.csproj @@ -25,9 +25,9 @@ - + - + @@ -35,7 +35,7 @@ all runtime; build; native; contentfiles; analyzers - + diff --git a/Sample/BankAccounts/EventSourcing.Sample.Transactions.Contracts/EventSourcing.Sample.Transactions.Contracts.csproj b/Sample/BankAccounts/EventSourcing.Sample.Transactions.Contracts/EventSourcing.Sample.Transactions.Contracts.csproj index e5ed3544d..39609b7c8 100644 --- a/Sample/BankAccounts/EventSourcing.Sample.Transactions.Contracts/EventSourcing.Sample.Transactions.Contracts.csproj +++ b/Sample/BankAccounts/EventSourcing.Sample.Transactions.Contracts/EventSourcing.Sample.Transactions.Contracts.csproj @@ -8,7 +8,7 @@ - + diff --git a/Sample/BankAccounts/EventSourcing.Sample.Transactions/EventSourcing.Sample.Transactions.csproj b/Sample/BankAccounts/EventSourcing.Sample.Transactions/EventSourcing.Sample.Transactions.csproj index 8da93cbd5..1f59cba70 100644 --- a/Sample/BankAccounts/EventSourcing.Sample.Transactions/EventSourcing.Sample.Transactions.csproj +++ b/Sample/BankAccounts/EventSourcing.Sample.Transactions/EventSourcing.Sample.Transactions.csproj @@ -8,7 +8,7 @@ - + diff --git a/Sample/BankAccounts/EventSourcing.Sample.Web/EventSourcing.Sample.Web.csproj b/Sample/BankAccounts/EventSourcing.Sample.Web/EventSourcing.Sample.Web.csproj index 8a5765ee0..e6d9abfa4 100644 --- a/Sample/BankAccounts/EventSourcing.Sample.Web/EventSourcing.Sample.Web.csproj +++ b/Sample/BankAccounts/EventSourcing.Sample.Web/EventSourcing.Sample.Web.csproj @@ -20,8 +20,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -32,12 +32,12 @@ - - + + - + diff --git a/Sample/BankAccounts/EventSourcing.Sample.Web/Startup.cs b/Sample/BankAccounts/EventSourcing.Sample.Web/Startup.cs index 9e552450d..61ab01048 100644 --- a/Sample/BankAccounts/EventSourcing.Sample.Web/Startup.cs +++ b/Sample/BankAccounts/EventSourcing.Sample.Web/Startup.cs @@ -102,10 +102,10 @@ private void ConfigureMarten(IServiceCollection services) options.Events.DatabaseSchemaName = schemaName; options.DatabaseSchemaName = schemaName; - options.Events.Projections.SelfAggregate(); - options.Events.Projections.Add(); - options.Events.Projections.Add(); - options.Events.Projections.Add(); + options.Projections.SelfAggregate(); + options.Projections.Add(); + options.Projections.Add(); + options.Projections.Add(); options.Events.AddEventType(typeof(NewAccountCreated)); options.Events.AddEventType(typeof(NewInflowRecorded)); diff --git a/Sample/ECommerce/Carts/Carts.Api.Tests/Carts.Api.Tests.csproj b/Sample/ECommerce/Carts/Carts.Api.Tests/Carts.Api.Tests.csproj index a1c4792aa..747357bce 100644 --- a/Sample/ECommerce/Carts/Carts.Api.Tests/Carts.Api.Tests.csproj +++ b/Sample/ECommerce/Carts/Carts.Api.Tests/Carts.Api.Tests.csproj @@ -11,11 +11,11 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Sample/ECommerce/Carts/Carts.Api/Carts.Api.csproj b/Sample/ECommerce/Carts/Carts.Api/Carts.Api.csproj index 730b2b0ab..13039613d 100644 --- a/Sample/ECommerce/Carts/Carts.Api/Carts.Api.csproj +++ b/Sample/ECommerce/Carts/Carts.Api/Carts.Api.csproj @@ -8,13 +8,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Sample/ECommerce/Carts/Carts.Tests/Carts.Tests.csproj b/Sample/ECommerce/Carts/Carts.Tests/Carts.Tests.csproj index a92032491..9ebaea3fd 100644 --- a/Sample/ECommerce/Carts/Carts.Tests/Carts.Tests.csproj +++ b/Sample/ECommerce/Carts/Carts.Tests/Carts.Tests.csproj @@ -9,14 +9,14 @@ - + all runtime; build; native; contentfiles; analyzers - + diff --git a/Sample/ECommerce/Carts/Carts/Carts.csproj b/Sample/ECommerce/Carts/Carts/Carts.csproj index b98cd98ce..678c5e6c6 100644 --- a/Sample/ECommerce/Carts/Carts/Carts.csproj +++ b/Sample/ECommerce/Carts/Carts/Carts.csproj @@ -12,7 +12,7 @@ - + diff --git a/Sample/ECommerce/Carts/Carts/Carts/Config.cs b/Sample/ECommerce/Carts/Carts/Carts/Config.cs index 2d0765345..fbdd3bb10 100644 --- a/Sample/ECommerce/Carts/Carts/Carts/Config.cs +++ b/Sample/ECommerce/Carts/Carts/Carts/Config.cs @@ -50,13 +50,13 @@ private static void AddEventHandlers(IServiceCollection services) internal static void ConfigureCarts(this StoreOptions options) { // Snapshots - options.Events.Projections.SelfAggregate(); + options.Projections.SelfAggregate(); // // projections - options.Events.Projections.Add(); - options.Events.Projections.Add(); + options.Projections.Add(); + options.Projections.Add(); // // // transformation - options.Events.Projections.Add(); + options.Projections.Add(); } } } diff --git a/Sample/ECommerce/Orders/Orders.Api.Tests/Orders.Api.Tests.csproj b/Sample/ECommerce/Orders/Orders.Api.Tests/Orders.Api.Tests.csproj index 280655755..18942298f 100644 --- a/Sample/ECommerce/Orders/Orders.Api.Tests/Orders.Api.Tests.csproj +++ b/Sample/ECommerce/Orders/Orders.Api.Tests/Orders.Api.Tests.csproj @@ -11,11 +11,11 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Sample/ECommerce/Orders/Orders.Api/Orders.Api.csproj b/Sample/ECommerce/Orders/Orders.Api/Orders.Api.csproj index 6ca5a1327..6ab1fa3c4 100644 --- a/Sample/ECommerce/Orders/Orders.Api/Orders.Api.csproj +++ b/Sample/ECommerce/Orders/Orders.Api/Orders.Api.csproj @@ -7,15 +7,15 @@ - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Sample/ECommerce/Orders/Orders.Tests/Orders.Tests.csproj b/Sample/ECommerce/Orders/Orders.Tests/Orders.Tests.csproj index 76c74c723..a380f60a3 100644 --- a/Sample/ECommerce/Orders/Orders.Tests/Orders.Tests.csproj +++ b/Sample/ECommerce/Orders/Orders.Tests/Orders.Tests.csproj @@ -9,14 +9,14 @@ - + all runtime; build; native; contentfiles; analyzers - + diff --git a/Sample/ECommerce/Orders/Orders/Orders.csproj b/Sample/ECommerce/Orders/Orders/Orders.csproj index ce0e8e954..6decc22c2 100644 --- a/Sample/ECommerce/Orders/Orders/Orders.csproj +++ b/Sample/ECommerce/Orders/Orders/Orders.csproj @@ -12,7 +12,7 @@ - + diff --git a/Sample/ECommerce/Orders/Orders/Orders/Config.cs b/Sample/ECommerce/Orders/Orders/Orders/Config.cs index acbd83ae6..95b9d016f 100644 --- a/Sample/ECommerce/Orders/Orders/Orders/Config.cs +++ b/Sample/ECommerce/Orders/Orders/Orders/Config.cs @@ -42,7 +42,7 @@ private static IServiceCollection AddEventHandlers(this IServiceCollection servi internal static void ConfigureOrders(this StoreOptions options) { // Snapshots - options.Events.Projections.SelfAggregate(); + options.Projections.SelfAggregate(); } } } diff --git a/Sample/ECommerce/Payments/Payments.Api.Tests/Payments.Api.Tests.csproj b/Sample/ECommerce/Payments/Payments.Api.Tests/Payments.Api.Tests.csproj index 04662b0de..cf0b5e68e 100644 --- a/Sample/ECommerce/Payments/Payments.Api.Tests/Payments.Api.Tests.csproj +++ b/Sample/ECommerce/Payments/Payments.Api.Tests/Payments.Api.Tests.csproj @@ -11,11 +11,11 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Sample/ECommerce/Payments/Payments.Api/Payments.Api.csproj b/Sample/ECommerce/Payments/Payments.Api/Payments.Api.csproj index adf6ddfbf..87941d55b 100644 --- a/Sample/ECommerce/Payments/Payments.Api/Payments.Api.csproj +++ b/Sample/ECommerce/Payments/Payments.Api/Payments.Api.csproj @@ -7,15 +7,15 @@ - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Sample/ECommerce/Payments/Payments.Tests/Payments.Tests.csproj b/Sample/ECommerce/Payments/Payments.Tests/Payments.Tests.csproj index 5795aad90..8a836fa71 100644 --- a/Sample/ECommerce/Payments/Payments.Tests/Payments.Tests.csproj +++ b/Sample/ECommerce/Payments/Payments.Tests/Payments.Tests.csproj @@ -9,14 +9,14 @@ - + all runtime; build; native; contentfiles; analyzers - + diff --git a/Sample/ECommerce/Payments/Payments/Payments.csproj b/Sample/ECommerce/Payments/Payments/Payments.csproj index aa8fde54f..89665ce5c 100644 --- a/Sample/ECommerce/Payments/Payments/Payments.csproj +++ b/Sample/ECommerce/Payments/Payments/Payments.csproj @@ -12,7 +12,7 @@ - + diff --git a/Sample/ECommerce/Payments/Payments/Payments/Config.cs b/Sample/ECommerce/Payments/Payments/Payments/Config.cs index 04f20ca9f..f3e042ba9 100644 --- a/Sample/ECommerce/Payments/Payments/Payments/Config.cs +++ b/Sample/ECommerce/Payments/Payments/Payments/Config.cs @@ -36,7 +36,7 @@ private static void AddEventHandlers(IServiceCollection services) internal static void ConfigurePayments(this StoreOptions options) { // Snapshots - options.Events.Projections.SelfAggregate(); + options.Projections.SelfAggregate(); } } } diff --git a/Sample/ECommerce/Shipments/Shipments.Api.Tests/Shipments.Api.Tests.csproj b/Sample/ECommerce/Shipments/Shipments.Api.Tests/Shipments.Api.Tests.csproj index e471b2810..17b337523 100644 --- a/Sample/ECommerce/Shipments/Shipments.Api.Tests/Shipments.Api.Tests.csproj +++ b/Sample/ECommerce/Shipments/Shipments.Api.Tests/Shipments.Api.Tests.csproj @@ -11,11 +11,11 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Sample/ECommerce/Shipments/Shipments.Api/Shipments.Api.csproj b/Sample/ECommerce/Shipments/Shipments.Api/Shipments.Api.csproj index 2aa868d98..4a756400a 100644 --- a/Sample/ECommerce/Shipments/Shipments.Api/Shipments.Api.csproj +++ b/Sample/ECommerce/Shipments/Shipments.Api/Shipments.Api.csproj @@ -8,13 +8,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Sample/ECommerce/Shipments/Shipments.Tests/Shipments.Tests.csproj b/Sample/ECommerce/Shipments/Shipments.Tests/Shipments.Tests.csproj index 0aa4a7d6e..6ea7a3740 100644 --- a/Sample/ECommerce/Shipments/Shipments.Tests/Shipments.Tests.csproj +++ b/Sample/ECommerce/Shipments/Shipments.Tests/Shipments.Tests.csproj @@ -9,14 +9,14 @@ - + all runtime; build; native; contentfiles; analyzers - + diff --git a/Sample/ECommerce/Shipments/Shipments/Shipments.csproj b/Sample/ECommerce/Shipments/Shipments/Shipments.csproj index 91347c9fa..9a96ca6ef 100644 --- a/Sample/ECommerce/Shipments/Shipments/Shipments.csproj +++ b/Sample/ECommerce/Shipments/Shipments/Shipments.csproj @@ -12,14 +12,14 @@ - - + + all runtime; build; native; contentfiles; analyzers - + diff --git a/Sample/MeetingsManagement/MeetingsManagement.Api/MeetingsManagement.Api.csproj b/Sample/MeetingsManagement/MeetingsManagement.Api/MeetingsManagement.Api.csproj index cf128826a..cfeef8ad8 100644 --- a/Sample/MeetingsManagement/MeetingsManagement.Api/MeetingsManagement.Api.csproj +++ b/Sample/MeetingsManagement/MeetingsManagement.Api/MeetingsManagement.Api.csproj @@ -7,10 +7,10 @@ - + - + diff --git a/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/MeetingsManagement.IntegrationTests.csproj b/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/MeetingsManagement.IntegrationTests.csproj index ea345ada8..bc7b84542 100644 --- a/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/MeetingsManagement.IntegrationTests.csproj +++ b/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/MeetingsManagement.IntegrationTests.csproj @@ -15,11 +15,11 @@ - + - + @@ -27,7 +27,7 @@ all runtime; build; native; contentfiles; analyzers - + diff --git a/Sample/MeetingsManagement/MeetingsManagement/Meetings/Config.cs b/Sample/MeetingsManagement/MeetingsManagement/Meetings/Config.cs index a5d56e71d..61fd28160 100644 --- a/Sample/MeetingsManagement/MeetingsManagement/Meetings/Config.cs +++ b/Sample/MeetingsManagement/MeetingsManagement/Meetings/Config.cs @@ -25,8 +25,8 @@ public static void AddMeeting(this IServiceCollection services) public static void ConfigureMarten(StoreOptions options) { - options.Events.Projections.SelfAggregate(); - options.Events.Projections.Add(new MeetingViewProjection()); + options.Projections.SelfAggregate(); + options.Projections.Add(new MeetingViewProjection()); } } } diff --git a/Sample/MeetingsManagement/MeetingsManagement/MeetingsManagement.csproj b/Sample/MeetingsManagement/MeetingsManagement/MeetingsManagement.csproj index 536c3768c..470ae8843 100644 --- a/Sample/MeetingsManagement/MeetingsManagement/MeetingsManagement.csproj +++ b/Sample/MeetingsManagement/MeetingsManagement/MeetingsManagement.csproj @@ -8,7 +8,7 @@ - + diff --git a/Sample/MeetingsManagement/MeetingsSearch.Api/MeetingsSearch.Api.csproj b/Sample/MeetingsManagement/MeetingsSearch.Api/MeetingsSearch.Api.csproj index d96fc1b7c..402642199 100644 --- a/Sample/MeetingsManagement/MeetingsSearch.Api/MeetingsSearch.Api.csproj +++ b/Sample/MeetingsManagement/MeetingsSearch.Api/MeetingsSearch.Api.csproj @@ -9,7 +9,7 @@ - + diff --git a/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/MeetingsSearch.IntegrationTests.csproj b/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/MeetingsSearch.IntegrationTests.csproj index a2a6c673b..f574389e8 100644 --- a/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/MeetingsSearch.IntegrationTests.csproj +++ b/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/MeetingsSearch.IntegrationTests.csproj @@ -15,11 +15,11 @@ - + - + @@ -27,7 +27,7 @@ all runtime; build; native; contentfiles; analyzers - + diff --git a/Sample/MeetingsManagement/MeetingsSearch/MeetingsSearch.csproj b/Sample/MeetingsManagement/MeetingsSearch/MeetingsSearch.csproj index e9e903366..0617ff2e9 100644 --- a/Sample/MeetingsManagement/MeetingsSearch/MeetingsSearch.csproj +++ b/Sample/MeetingsManagement/MeetingsSearch/MeetingsSearch.csproj @@ -7,7 +7,7 @@ - + diff --git a/Sample/Tickets/Tickets.Api.Tests/Tickets.Api.Tests.csproj b/Sample/Tickets/Tickets.Api.Tests/Tickets.Api.Tests.csproj index 70a0d9202..559008ac6 100644 --- a/Sample/Tickets/Tickets.Api.Tests/Tickets.Api.Tests.csproj +++ b/Sample/Tickets/Tickets.Api.Tests/Tickets.Api.Tests.csproj @@ -11,11 +11,11 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Sample/Tickets/Tickets.Api/Tickets.Api.csproj b/Sample/Tickets/Tickets.Api/Tickets.Api.csproj index 16bb9b7d0..de5c2778e 100644 --- a/Sample/Tickets/Tickets.Api/Tickets.Api.csproj +++ b/Sample/Tickets/Tickets.Api/Tickets.Api.csproj @@ -8,7 +8,7 @@ - + diff --git a/Sample/Tickets/Tickets.Tests/Tickets.Tests.csproj b/Sample/Tickets/Tickets.Tests/Tickets.Tests.csproj index 0e347d601..9088e9aa2 100644 --- a/Sample/Tickets/Tickets.Tests/Tickets.Tests.csproj +++ b/Sample/Tickets/Tickets.Tests/Tickets.Tests.csproj @@ -9,15 +9,15 @@ - - + + all runtime; build; native; contentfiles; analyzers - + diff --git a/Sample/Tickets/Tickets/Reservations/ReservationsConfig.cs b/Sample/Tickets/Tickets/Reservations/ReservationsConfig.cs index 712dade50..22a8d0395 100644 --- a/Sample/Tickets/Tickets/Reservations/ReservationsConfig.cs +++ b/Sample/Tickets/Tickets/Reservations/ReservationsConfig.cs @@ -43,7 +43,7 @@ private static void AddQueryHandlers(IServiceCollection services) internal static void ConfigureReservations(this StoreOptions options) { // Snapshots - options.Events.Projections.SelfAggregate(); + options.Projections.SelfAggregate(); options.Schema.For().Index(x => x.SeatId, x => { x.IsUnique = true; @@ -63,11 +63,11 @@ internal static void ConfigureReservations(this StoreOptions options) // options.Schema.For().UniqueIndex(x => x.SeatId); // projections - options.Events.Projections.Add(); - options.Events.Projections.Add(); + options.Projections.Add(); + options.Projections.Add(); // transformation - options.Events.Projections.Add(); + options.Projections.Add(); } } } diff --git a/Sample/Tickets/Tickets/Tickets.csproj b/Sample/Tickets/Tickets/Tickets.csproj index 75f69b2a4..1c999f6e6 100644 --- a/Sample/Tickets/Tickets/Tickets.csproj +++ b/Sample/Tickets/Tickets/Tickets.csproj @@ -30,7 +30,7 @@ - + diff --git a/Sample/Warehouse/Warehouse.Api.Tests/Warehouse.Api.Tests.csproj b/Sample/Warehouse/Warehouse.Api.Tests/Warehouse.Api.Tests.csproj index fde345ac8..fcc095502 100644 --- a/Sample/Warehouse/Warehouse.Api.Tests/Warehouse.Api.Tests.csproj +++ b/Sample/Warehouse/Warehouse.Api.Tests/Warehouse.Api.Tests.csproj @@ -8,17 +8,13 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - diff --git a/Sample/Warehouse/Warehouse.Api/Warehouse.Api.csproj b/Sample/Warehouse/Warehouse.Api/Warehouse.Api.csproj index 0d3177930..ec093e1f3 100644 --- a/Sample/Warehouse/Warehouse.Api/Warehouse.Api.csproj +++ b/Sample/Warehouse/Warehouse.Api/Warehouse.Api.csproj @@ -7,10 +7,10 @@ - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Sample/Warehouse/Warehouse/Configuration.cs b/Sample/Warehouse/Warehouse/Configuration.cs index 403c14c0a..99de4c6d6 100644 --- a/Sample/Warehouse/Warehouse/Configuration.cs +++ b/Sample/Warehouse/Warehouse/Configuration.cs @@ -21,7 +21,7 @@ public static IEndpointRouteBuilder UseWarehouseEndpoints(this IEndpointRouteBui public static IApplicationBuilder ConfigureWarehouse(this IApplicationBuilder app) { - var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); + var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Development"; if (environment == "Development") { diff --git a/Sample/Warehouse/Warehouse/Warehouse.csproj b/Sample/Warehouse/Warehouse/Warehouse.csproj index f8ddf73de..722741c4b 100644 --- a/Sample/Warehouse/Warehouse/Warehouse.csproj +++ b/Sample/Warehouse/Warehouse/Warehouse.csproj @@ -20,12 +20,12 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Workshops/BuildYourOwnEventStore/01-CreateStreamsTable/01-CreateStreamsTable.csproj b/Workshops/BuildYourOwnEventStore/01-CreateStreamsTable/01-CreateStreamsTable.csproj index e0dfc8a3a..a6da80fcf 100644 --- a/Workshops/BuildYourOwnEventStore/01-CreateStreamsTable/01-CreateStreamsTable.csproj +++ b/Workshops/BuildYourOwnEventStore/01-CreateStreamsTable/01-CreateStreamsTable.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/Workshops/BuildYourOwnEventStore/02-CreateEventsTable/02-CreateEventsTable.csproj b/Workshops/BuildYourOwnEventStore/02-CreateEventsTable/02-CreateEventsTable.csproj index e0dfc8a3a..a6da80fcf 100644 --- a/Workshops/BuildYourOwnEventStore/02-CreateEventsTable/02-CreateEventsTable.csproj +++ b/Workshops/BuildYourOwnEventStore/02-CreateEventsTable/02-CreateEventsTable.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/Workshops/BuildYourOwnEventStore/03-CreateAppendEventFunction/03-CreateAppendEventFunction.csproj b/Workshops/BuildYourOwnEventStore/03-CreateAppendEventFunction/03-CreateAppendEventFunction.csproj index e0dfc8a3a..a6da80fcf 100644 --- a/Workshops/BuildYourOwnEventStore/03-CreateAppendEventFunction/03-CreateAppendEventFunction.csproj +++ b/Workshops/BuildYourOwnEventStore/03-CreateAppendEventFunction/03-CreateAppendEventFunction.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/Workshops/BuildYourOwnEventStore/03-OptimisticConcurrency/03-OptimisticConcurrency.csproj b/Workshops/BuildYourOwnEventStore/03-OptimisticConcurrency/03-OptimisticConcurrency.csproj index e0dfc8a3a..a6da80fcf 100644 --- a/Workshops/BuildYourOwnEventStore/03-OptimisticConcurrency/03-OptimisticConcurrency.csproj +++ b/Workshops/BuildYourOwnEventStore/03-OptimisticConcurrency/03-OptimisticConcurrency.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/Workshops/BuildYourOwnEventStore/04-EventStoreMethods/04-EventStoreMethods.csproj b/Workshops/BuildYourOwnEventStore/04-EventStoreMethods/04-EventStoreMethods.csproj index e0dfc8a3a..a6da80fcf 100644 --- a/Workshops/BuildYourOwnEventStore/04-EventStoreMethods/04-EventStoreMethods.csproj +++ b/Workshops/BuildYourOwnEventStore/04-EventStoreMethods/04-EventStoreMethods.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/Workshops/BuildYourOwnEventStore/05-StreamAggregation/05-StreamAggregation.csproj b/Workshops/BuildYourOwnEventStore/05-StreamAggregation/05-StreamAggregation.csproj index e0dfc8a3a..a6da80fcf 100644 --- a/Workshops/BuildYourOwnEventStore/05-StreamAggregation/05-StreamAggregation.csproj +++ b/Workshops/BuildYourOwnEventStore/05-StreamAggregation/05-StreamAggregation.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/Workshops/BuildYourOwnEventStore/06-TimeTraveling/06-TimeTraveling.csproj b/Workshops/BuildYourOwnEventStore/06-TimeTraveling/06-TimeTraveling.csproj index e0dfc8a3a..a6da80fcf 100644 --- a/Workshops/BuildYourOwnEventStore/06-TimeTraveling/06-TimeTraveling.csproj +++ b/Workshops/BuildYourOwnEventStore/06-TimeTraveling/06-TimeTraveling.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/Workshops/BuildYourOwnEventStore/07-AggregateAndRepository/07-AggregateAndRepository.csproj b/Workshops/BuildYourOwnEventStore/07-AggregateAndRepository/07-AggregateAndRepository.csproj index e0dfc8a3a..a6da80fcf 100644 --- a/Workshops/BuildYourOwnEventStore/07-AggregateAndRepository/07-AggregateAndRepository.csproj +++ b/Workshops/BuildYourOwnEventStore/07-AggregateAndRepository/07-AggregateAndRepository.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/Workshops/BuildYourOwnEventStore/08-Snapshots/08-Snapshots.csproj b/Workshops/BuildYourOwnEventStore/08-Snapshots/08-Snapshots.csproj index 64c3fd517..2e06ad0f2 100644 --- a/Workshops/BuildYourOwnEventStore/08-Snapshots/08-Snapshots.csproj +++ b/Workshops/BuildYourOwnEventStore/08-Snapshots/08-Snapshots.csproj @@ -8,8 +8,8 @@ - - + + all diff --git a/Workshops/BuildYourOwnEventStore/09-Projections/09-Projections.csproj b/Workshops/BuildYourOwnEventStore/09-Projections/09-Projections.csproj index e0dfc8a3a..a6da80fcf 100644 --- a/Workshops/BuildYourOwnEventStore/09-Projections/09-Projections.csproj +++ b/Workshops/BuildYourOwnEventStore/09-Projections/09-Projections.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/10-ProjectionsWithMarten.csproj b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/10-ProjectionsWithMarten.csproj index e0dfc8a3a..a6da80fcf 100644 --- a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/10-ProjectionsWithMarten.csproj +++ b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/10-ProjectionsWithMarten.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/Exercise10ProjectionsWithMarten.cs b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/Exercise10ProjectionsWithMarten.cs index 9df5466d0..7ada4b994 100644 --- a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/Exercise10ProjectionsWithMarten.cs +++ b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/Exercise10ProjectionsWithMarten.cs @@ -3,6 +3,7 @@ using FluentAssertions; using Marten; using Marten.Events.Projections; +using Weasel.Postgresql; using Xunit; namespace EventStoreBasics.Tests @@ -165,9 +166,9 @@ public Exercise10ProjectionsWithMarten() options.Connection(Settings.ConnectionString); options.AutoCreateSchemaObjects = AutoCreate.All; options.DatabaseSchemaName = options.Events.DatabaseSchemaName = nameof(Exercise10ProjectionsWithMarten); - options.Events.Projections.SelfAggregate(); - options.Events.Projections.SelfAggregate(); - options.Events.Projections.Add(); + options.Projections.SelfAggregate(); + options.Projections.SelfAggregate(); + options.Projections.Add(); }); documentSession = store.OpenSession(); @@ -197,7 +198,7 @@ public void AddingAndUpdatingAggregate_ShouldCreateAndUpdateSnapshotAccordingly( var userDashboard = documentSession.Load(user.Id); userDashboard.Should().NotBeNull(); - userDashboard.Id.Should().Be(user.Id); + userDashboard!.Id.Should().Be(user.Id); userDashboard.UserName.Should().Be(user.Name); userDashboard.OrdersCount.Should().Be(2); userDashboard.TotalAmount.Should().Be(firstOrder.Amount + secondOrder.Amount); diff --git a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/IRepository.cs b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/IRepository.cs index ac5beebd8..cc7e7b8c1 100644 --- a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/IRepository.cs +++ b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/IRepository.cs @@ -4,7 +4,7 @@ namespace EventStoreBasics { public interface IRepository where T : IAggregate { - T Find(Guid id); + T? Find(Guid id); void Add(T aggregate); diff --git a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/MartenRepository.cs b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/MartenRepository.cs index fe65e355e..ee2c021e5 100644 --- a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/MartenRepository.cs +++ b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/MartenRepository.cs @@ -13,7 +13,7 @@ public MartenRepository(IDocumentSession documentSession) this.documentSession = documentSession ?? throw new ArgumentNullException(nameof(documentSession)); } - public T Find(Guid id) + public T? Find(Guid id) { return documentSession.Events.AggregateStream(id); } diff --git a/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/EventStoreBasics.Tests.csproj b/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/EventStoreBasics.Tests.csproj index 69836ddd7..25f362069 100644 --- a/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/EventStoreBasics.Tests.csproj +++ b/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/EventStoreBasics.Tests.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/Exercise10ProjectionsWithMarten.cs b/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/Exercise10ProjectionsWithMarten.cs index 86ce3b3b4..a2454d056 100644 --- a/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/Exercise10ProjectionsWithMarten.cs +++ b/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/Exercise10ProjectionsWithMarten.cs @@ -3,6 +3,7 @@ using FluentAssertions; using Marten; using Marten.Events.Projections; +using Weasel.Postgresql; using Xunit; namespace EventStoreBasics.Tests @@ -173,12 +174,12 @@ public Exercise10ProjectionsWithMarten() options.AutoCreateSchemaObjects = AutoCreate.All; options.DatabaseSchemaName = options.Events.DatabaseSchemaName = nameof(Exercise10ProjectionsWithMarten); - options.Events.Projections.SelfAggregate(); - options.Events.Projections.SelfAggregate(); - options.Events.Projections.Add(); + options.Projections.SelfAggregate(); + options.Projections.SelfAggregate(); + options.Projections.Add(); // options.Events.AddEventTypes(new[] {typeof(UserCreated)}); - // options.Events.Projections.Add(new UserDashboardProjection()); + // options.Projections.Add(new UserDashboardProjection()); }); documentSession = store.OpenSession(); @@ -207,7 +208,7 @@ public void AddingAndUpdatingAggregate_ShouldCreateAndUpdateSnapshotAccordingly( var userDashboard = documentSession.Load(user.Id); userDashboard.Should().NotBeNull(); - userDashboard.Id.Should().Be(user.Id); + userDashboard!.Id.Should().Be(user.Id); userDashboard.UserName.Should().Be(user.Name); userDashboard.OrdersCount.Should().Be(2); userDashboard.TotalAmount.Should().Be(firstOrder.Amount + secondOrder.Amount); diff --git a/Workshops/BuildYourOwnEventStore/EventStoreBasics/EventStoreBasics.csproj b/Workshops/BuildYourOwnEventStore/EventStoreBasics/EventStoreBasics.csproj index 0a19bad70..0694a0cbd 100644 --- a/Workshops/BuildYourOwnEventStore/EventStoreBasics/EventStoreBasics.csproj +++ b/Workshops/BuildYourOwnEventStore/EventStoreBasics/EventStoreBasics.csproj @@ -9,7 +9,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/EventStoreBasics/MartenRepository.cs b/Workshops/BuildYourOwnEventStore/EventStoreBasics/MartenRepository.cs index fe65e355e..643429f52 100644 --- a/Workshops/BuildYourOwnEventStore/EventStoreBasics/MartenRepository.cs +++ b/Workshops/BuildYourOwnEventStore/EventStoreBasics/MartenRepository.cs @@ -15,7 +15,12 @@ public MartenRepository(IDocumentSession documentSession) public T Find(Guid id) { - return documentSession.Events.AggregateStream(id); + var aggregate = documentSession.Events.AggregateStream(id); + + if (aggregate == default) + throw new ArgumentNullException(nameof(aggregate)); + + return aggregate; } public void Add(T aggregate) diff --git a/Workshops/BuildYourOwnEventStore/Tools/Tools.csproj b/Workshops/BuildYourOwnEventStore/Tools/Tools.csproj index 01cfc866a..fce9d0545 100644 --- a/Workshops/BuildYourOwnEventStore/Tools/Tools.csproj +++ b/Workshops/BuildYourOwnEventStore/Tools/Tools.csproj @@ -9,7 +9,7 @@ - +