From 84b68eb1ba14e66edd9a9e686379c10219bcb303 Mon Sep 17 00:00:00 2001 From: Oskar Dudycz Date: Tue, 30 Apr 2024 09:39:15 +0200 Subject: [PATCH] Used collection extensions from C# 12 where possible --- Core.Serialization/Newtonsoft/JsonObjectContractProvider.cs | 2 +- .../Helpdesk.Api/Incidents/GettingDetails/IncidentDetails.cs | 2 +- .../Helpdesk.Api.Tests/Incidents/LogIncidentsTests.cs | 2 +- .../Incidents/GetIncidentDetails/IncidentDetails.cs | 2 +- .../GroupCheckoutTests.RecordGuestCheckoutFailure.cs | 2 +- .../Choreography/GroupCheckouts/GroupCheckout.cs | 4 ++-- Sample/decider/Decider/ProductItems.cs | 2 +- .../Immutable/GettingStateFromEventsTests.cs | 2 +- .../Mutable/GettingStateFromEventsTests.cs | 2 +- .../04-AppendingEvents.EventStoreDB/AppendingEvents.cs | 2 +- .../Immutable/GettingStateFromEventsTests.cs | 2 +- .../Mutable/GettingStateFromEventsTests.cs | 2 +- .../Immutable/GettingStateFromEventsTests.cs | 2 +- .../Mutable/GettingStateFromEventsTests.cs | 2 +- .../07-BusinessLogic/Immutable/BusinessLogicTests.cs | 4 ++-- .../07-BusinessLogic/Mutable/BusinessLogicTests.cs | 2 +- .../08-BusinessLogic.Marten/Immutable/BusinessLogic.cs | 2 +- .../08-BusinessLogic.Marten/Immutable/BusinessLogicTests.cs | 2 +- .../08-BusinessLogic.Marten/Mixed/BusinessLogicTests.cs | 2 +- .../08-BusinessLogic.Marten/Mutable/BusinessLogicTests.cs | 2 +- .../09-BusinessLogic.EventStoreDB/Immutable/BusinessLogic.cs | 2 +- .../Immutable/BusinessLogicTests.cs | 2 +- .../09-BusinessLogic.EventStoreDB/Mixed/BusinessLogicTests.cs | 2 +- .../Mutable/BusinessLogicTests.cs | 2 +- .../Immutable/BusinessLogic.cs | 2 +- .../Immutable/OptimisticConcurrencyTests.cs | 2 +- .../Mixed/OptimisticConcurrencyTests.cs | 2 +- .../Mutable/OptimisticConcurrencyTests.cs | 2 +- .../Immutable/BusinessLogic.cs | 2 +- .../Immutable/OptimisticConcurrencyTests.cs | 2 +- .../Mixed/OptimisticConcurrencyTests.cs | 2 +- .../Mutable/OptimisticConcurrencyTests.cs | 2 +- .../01-EventsDefinition/Solution2/EventsDefinitionTests.cs | 2 +- .../Immutable/Solution1/GettingStateFromEventsTests.cs | 2 +- .../Immutable/Solution2/GettingStateFromEventsTests.cs | 2 +- .../Mutable/GettingStateFromEventsTests.cs | 2 +- .../Solved/03-AppendingEvents.Marten/AppendingEvents.cs | 2 +- .../Solved/04-AppendingEvents.EventStoreDB/AppendingEvents.cs | 2 +- .../Immutable/GettingStateFromEventsTests.cs | 4 ++-- .../Mutable/GettingStateFromEventsTests.cs | 2 +- .../Immutable/GettingStateFromEventsTests.cs | 4 ++-- .../Mutable/GettingStateFromEventsTests.cs | 2 +- .../Solved/07-BusinessLogic/Immutable/BusinessLogic.cs | 2 +- .../Solved/07-BusinessLogic/Immutable/BusinessLogicTests.cs | 2 +- .../07-BusinessLogic/Mutable/Solution1/BusinessLogicTests.cs | 2 +- .../07-BusinessLogic/Mutable/Solution2/BusinessLogicTests.cs | 2 +- .../Immutable/Solution1/BusinessLogic.cs | 2 +- .../Immutable/Solution1/BusinessLogicTests.cs | 2 +- .../Immutable/Solution2/ShoppingCart.cs | 4 ++-- .../Immutable/Solution3/ShoppingCart.cs | 4 ++-- .../Immutable/Solution4/ShoppingCart.cs | 4 ++-- .../08-BusinessLogic.Marten/Mixed/BusinessLogicTests.cs | 2 +- .../08-BusinessLogic.Marten/Mutable/BusinessLogicTests.cs | 2 +- .../09-BusinessLogic.EventStoreDB/Immutable/BusinessLogic.cs | 2 +- .../Immutable/BusinessLogicTests.cs | 2 +- .../09-BusinessLogic.EventStoreDB/Mixed/BusinessLogicTests.cs | 2 +- .../Mutable/BusinessLogicTests.cs | 2 +- .../Immutable/BusinessLogic.cs | 2 +- .../Immutable/OptimisticConcurrencyTests.cs | 2 +- .../Mixed/OptimisticConcurrencyTests.cs | 2 +- .../Mutable/OptimisticConcurrencyTests.cs | 2 +- .../Immutable/BusinessLogic.cs | 2 +- .../Immutable/OptimisticConcurrencyTests.cs | 2 +- .../Mixed/OptimisticConcurrencyTests.cs | 2 +- .../Mutable/OptimisticConcurrencyTests.cs | 2 +- 65 files changed, 72 insertions(+), 72 deletions(-) diff --git a/Core.Serialization/Newtonsoft/JsonObjectContractProvider.cs b/Core.Serialization/Newtonsoft/JsonObjectContractProvider.cs index 5efcfdbae..4e304b8f5 100644 --- a/Core.Serialization/Newtonsoft/JsonObjectContractProvider.cs +++ b/Core.Serialization/Newtonsoft/JsonObjectContractProvider.cs @@ -39,7 +39,7 @@ private static ObjectConstructor GetObjectConstructor(MethodBase method) return a => method.Invoke(null, a)!; if (!c.GetParameters().Any()) - return _ => c.Invoke(Array.Empty()); + return _ => c.Invoke([]); return a => c.Invoke(a); } diff --git a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingDetails/IncidentDetails.cs b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingDetails/IncidentDetails.cs index b410ca22b..9c8d9bd22 100644 --- a/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingDetails/IncidentDetails.cs +++ b/Sample/Helpdesk.Wolverine/Helpdesk.Api/Incidents/GettingDetails/IncidentDetails.cs @@ -29,7 +29,7 @@ public enum IncidentNoteType public class IncidentDetailsProjection: SingleStreamProjection { public static IncidentDetails Create(IncidentLogged logged) => - new(logged.IncidentId, logged.CustomerId, IncidentStatus.Pending, Array.Empty()); + new(logged.IncidentId, logged.CustomerId, IncidentStatus.Pending, []); public IncidentDetails Apply(IncidentCategorised categorised, IncidentDetails current) => current with { Category = categorised.Category }; diff --git a/Sample/Helpdesk/Helpdesk.Api.Tests/Incidents/LogIncidentsTests.cs b/Sample/Helpdesk/Helpdesk.Api.Tests/Incidents/LogIncidentsTests.cs index 0c26a5bc1..e27786124 100644 --- a/Sample/Helpdesk/Helpdesk.Api.Tests/Incidents/LogIncidentsTests.cs +++ b/Sample/Helpdesk/Helpdesk.Api.Tests/Incidents/LogIncidentsTests.cs @@ -28,7 +28,7 @@ public class LogIncidentsTests: IClassFixture> ctx.GetCreatedId(), CustomerId, IncidentStatus.Pending, - Array.Empty(), + [], null, null, null, diff --git a/Sample/Helpdesk/Helpdesk.Api/Incidents/GetIncidentDetails/IncidentDetails.cs b/Sample/Helpdesk/Helpdesk.Api/Incidents/GetIncidentDetails/IncidentDetails.cs index 949cc4e2f..0db98d0cc 100644 --- a/Sample/Helpdesk/Helpdesk.Api/Incidents/GetIncidentDetails/IncidentDetails.cs +++ b/Sample/Helpdesk/Helpdesk.Api/Incidents/GetIncidentDetails/IncidentDetails.cs @@ -29,7 +29,7 @@ public enum IncidentNoteType public class IncidentDetailsProjection: SingleStreamProjection { public static IncidentDetails Create(IncidentLogged logged) => - new(logged.IncidentId, logged.CustomerId, IncidentStatus.Pending, Array.Empty()); + new(logged.IncidentId, logged.CustomerId, IncidentStatus.Pending, []); public IncidentDetails Apply(IncidentCategorised categorised, IncidentDetails current) => current with { Category = categorised.Category }; diff --git a/Sample/HotelManagement/HotelManagement.Tests/Sagas/GroupCheckouts/GroupCheckoutTests.RecordGuestCheckoutFailure.cs b/Sample/HotelManagement/HotelManagement.Tests/Sagas/GroupCheckouts/GroupCheckoutTests.RecordGuestCheckoutFailure.cs index d883f0619..0300a0055 100644 --- a/Sample/HotelManagement/HotelManagement.Tests/Sagas/GroupCheckouts/GroupCheckoutTests.RecordGuestCheckoutFailure.cs +++ b/Sample/HotelManagement/HotelManagement.Tests/Sagas/GroupCheckouts/GroupCheckoutTests.RecordGuestCheckoutFailure.cs @@ -59,7 +59,7 @@ public void GivenInitiatedGroupCheckout_WhenRecordLastGuestCheckoutFailure_ThenC new GuestCheckoutFailed(groupCheckoutId, guestStaysIds[2], now), new GroupCheckoutFailed( groupCheckoutId, - Array.Empty(), + [], guestStaysIds, now ) diff --git a/Sample/HotelManagement/HotelManagement/Choreography/GroupCheckouts/GroupCheckout.cs b/Sample/HotelManagement/HotelManagement/Choreography/GroupCheckouts/GroupCheckout.cs index 8a92206e0..385451069 100644 --- a/Sample/HotelManagement/HotelManagement/Choreography/GroupCheckouts/GroupCheckout.cs +++ b/Sample/HotelManagement/HotelManagement/Choreography/GroupCheckouts/GroupCheckout.cs @@ -72,7 +72,7 @@ DateTimeOffset now ) { if (Status == CheckoutStatus.Initiated && GuestStayCheckouts[guestStayId] != CheckoutStatus.Completed) - return Array.Empty(); + return []; var guestCheckoutCompleted = new GuestCheckoutCompleted(Id, guestStayId, now); @@ -89,7 +89,7 @@ DateTimeOffset now ) { if(Status == CheckoutStatus.Initiated && GuestStayCheckouts[guestStayId] != CheckoutStatus.Failed) - return Array.Empty(); + return []; var guestCheckoutFailed = new GuestCheckoutFailed(Id, guestStayId, now); diff --git a/Sample/decider/Decider/ProductItems.cs b/Sample/decider/Decider/ProductItems.cs index d7872192a..67f7fda34 100644 --- a/Sample/decider/Decider/ProductItems.cs +++ b/Sample/decider/Decider/ProductItems.cs @@ -13,7 +13,7 @@ decimal UnitPrice public class ProductItems { - public static ProductItems Empty = new(Array.Empty()); + public static ProductItems Empty = new([]); public PricedProductItem[] Values { get; } diff --git a/Workshops/IntroductionToEventSourcing/02-GettingStateFromEvents/Immutable/GettingStateFromEventsTests.cs b/Workshops/IntroductionToEventSourcing/02-GettingStateFromEvents/Immutable/GettingStateFromEventsTests.cs index 8da397250..403982b04 100644 --- a/Workshops/IntroductionToEventSourcing/02-GettingStateFromEvents/Immutable/GettingStateFromEventsTests.cs +++ b/Workshops/IntroductionToEventSourcing/02-GettingStateFromEvents/Immutable/GettingStateFromEventsTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/02-GettingStateFromEvents/Mutable/GettingStateFromEventsTests.cs b/Workshops/IntroductionToEventSourcing/02-GettingStateFromEvents/Mutable/GettingStateFromEventsTests.cs index e060c54f4..07ff543d9 100644 --- a/Workshops/IntroductionToEventSourcing/02-GettingStateFromEvents/Mutable/GettingStateFromEventsTests.cs +++ b/Workshops/IntroductionToEventSourcing/02-GettingStateFromEvents/Mutable/GettingStateFromEventsTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/04-AppendingEvents.EventStoreDB/AppendingEvents.cs b/Workshops/IntroductionToEventSourcing/04-AppendingEvents.EventStoreDB/AppendingEvents.cs index 79c726a33..dd6029682 100644 --- a/Workshops/IntroductionToEventSourcing/04-AppendingEvents.EventStoreDB/AppendingEvents.cs +++ b/Workshops/IntroductionToEventSourcing/04-AppendingEvents.EventStoreDB/AppendingEvents.cs @@ -33,7 +33,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/Immutable/GettingStateFromEventsTests.cs b/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/Immutable/GettingStateFromEventsTests.cs index 9f41519e7..40e5122d6 100644 --- a/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/Immutable/GettingStateFromEventsTests.cs +++ b/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/Immutable/GettingStateFromEventsTests.cs @@ -34,7 +34,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/Mutable/GettingStateFromEventsTests.cs b/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/Mutable/GettingStateFromEventsTests.cs index 21025731f..b91bfc3d7 100644 --- a/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/Mutable/GettingStateFromEventsTests.cs +++ b/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/Mutable/GettingStateFromEventsTests.cs @@ -34,7 +34,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/Immutable/GettingStateFromEventsTests.cs b/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/Immutable/GettingStateFromEventsTests.cs index 1c29b6f93..dd7f6237c 100644 --- a/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/Immutable/GettingStateFromEventsTests.cs +++ b/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/Immutable/GettingStateFromEventsTests.cs @@ -34,7 +34,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/Mutable/GettingStateFromEventsTests.cs b/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/Mutable/GettingStateFromEventsTests.cs index 2e294f50c..766fae67d 100644 --- a/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/Mutable/GettingStateFromEventsTests.cs +++ b/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/Mutable/GettingStateFromEventsTests.cs @@ -34,7 +34,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/07-BusinessLogic/Immutable/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/07-BusinessLogic/Immutable/BusinessLogicTests.cs index e95e01cf7..d478eaec5 100644 --- a/Workshops/IntroductionToEventSourcing/07-BusinessLogic/Immutable/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/07-BusinessLogic/Immutable/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } @@ -54,7 +54,7 @@ public record ShoppingCart( ) { public static ShoppingCart Default() => - new (default, default, default, Array.Empty()); + new (default, default, default, []); public static ShoppingCart When(ShoppingCart shoppingCart, object @event) { diff --git a/Workshops/IntroductionToEventSourcing/07-BusinessLogic/Mutable/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/07-BusinessLogic/Mutable/BusinessLogicTests.cs index c0f849e99..2f79606b2 100644 --- a/Workshops/IntroductionToEventSourcing/07-BusinessLogic/Mutable/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/07-BusinessLogic/Mutable/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Immutable/BusinessLogic.cs b/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Immutable/BusinessLogic.cs index d28f120c1..24b769e13 100644 --- a/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Immutable/BusinessLogic.cs +++ b/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Immutable/BusinessLogic.cs @@ -17,7 +17,7 @@ public record ShoppingCart( opened.ShoppingCartId, opened.ClientId, ShoppingCartStatus.Pending, - Array.Empty() + [] ); public ShoppingCart Apply(ProductItemAddedToShoppingCart productItemAdded) => diff --git a/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Immutable/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Immutable/BusinessLogicTests.cs index 99cb0422d..524277f37 100644 --- a/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Immutable/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Immutable/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Mixed/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Mixed/BusinessLogicTests.cs index 7c209e438..4d69abae9 100644 --- a/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Mixed/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Mixed/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Mutable/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Mutable/BusinessLogicTests.cs index cd015eeda..a708468ff 100644 --- a/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Mutable/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/Mutable/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogic.cs b/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogic.cs index c9c4d2c49..4db65427d 100644 --- a/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogic.cs +++ b/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogic.cs @@ -13,7 +13,7 @@ public record ShoppingCart( { public bool IsClosed => ShoppingCartStatus.Closed.HasFlag(Status); public static ShoppingCart Default() => - new (default, default, default, Array.Empty()); + new (default, default, default, []); public static string StreamName(Guid id) => $"shopping_cart-{id}"; diff --git a/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogicTests.cs index 51380d83b..d801e2c53 100644 --- a/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Mixed/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Mixed/BusinessLogicTests.cs index 15b50962e..4d311c266 100644 --- a/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Mixed/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Mixed/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Mutable/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Mutable/BusinessLogicTests.cs index 62a9f473a..de6b5fe13 100644 --- a/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Mutable/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/Mutable/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Immutable/BusinessLogic.cs b/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Immutable/BusinessLogic.cs index ac3e5b15c..afab8942c 100644 --- a/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Immutable/BusinessLogic.cs +++ b/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Immutable/BusinessLogic.cs @@ -17,7 +17,7 @@ public record ShoppingCart( opened.ShoppingCartId, opened.ClientId, ShoppingCartStatus.Pending, - Array.Empty() + [] ); public ShoppingCart Apply(ProductItemAddedToShoppingCart productItemAdded) => diff --git a/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Immutable/OptimisticConcurrencyTests.cs b/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Immutable/OptimisticConcurrencyTests.cs index 8d37fe3dc..2f4aa36d9 100644 --- a/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Immutable/OptimisticConcurrencyTests.cs +++ b/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Immutable/OptimisticConcurrencyTests.cs @@ -33,7 +33,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Mixed/OptimisticConcurrencyTests.cs b/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Mixed/OptimisticConcurrencyTests.cs index 592441488..c04e087fa 100644 --- a/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Mixed/OptimisticConcurrencyTests.cs +++ b/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Mixed/OptimisticConcurrencyTests.cs @@ -33,7 +33,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Mutable/OptimisticConcurrencyTests.cs b/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Mutable/OptimisticConcurrencyTests.cs index b865bbbfa..758b4e83b 100644 --- a/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Mutable/OptimisticConcurrencyTests.cs +++ b/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/Mutable/OptimisticConcurrencyTests.cs @@ -33,7 +33,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Immutable/BusinessLogic.cs b/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Immutable/BusinessLogic.cs index 8519ab9fc..caa81cc71 100644 --- a/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Immutable/BusinessLogic.cs +++ b/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Immutable/BusinessLogic.cs @@ -13,7 +13,7 @@ public record ShoppingCart( { public bool IsClosed => ShoppingCartStatus.Closed.HasFlag(Status); public static ShoppingCart Default() => - new (default, default, default, Array.Empty()); + new (default, default, default, []); public static string StreamName(Guid id) => $"shopping_cart-{id}"; diff --git a/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Immutable/OptimisticConcurrencyTests.cs b/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Immutable/OptimisticConcurrencyTests.cs index 7a79377eb..d6f26cf70 100644 --- a/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Immutable/OptimisticConcurrencyTests.cs +++ b/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Immutable/OptimisticConcurrencyTests.cs @@ -33,7 +33,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Mixed/OptimisticConcurrencyTests.cs b/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Mixed/OptimisticConcurrencyTests.cs index 3d921bf3d..812134c59 100644 --- a/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Mixed/OptimisticConcurrencyTests.cs +++ b/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Mixed/OptimisticConcurrencyTests.cs @@ -33,7 +33,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Mutable/OptimisticConcurrencyTests.cs b/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Mutable/OptimisticConcurrencyTests.cs index 11e9898c9..a3635e3de 100644 --- a/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Mutable/OptimisticConcurrencyTests.cs +++ b/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/Mutable/OptimisticConcurrencyTests.cs @@ -33,7 +33,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/01-EventsDefinition/Solution2/EventsDefinitionTests.cs b/Workshops/IntroductionToEventSourcing/Solved/01-EventsDefinition/Solution2/EventsDefinitionTests.cs index 54f989014..5fd2ab68d 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/01-EventsDefinition/Solution2/EventsDefinitionTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/01-EventsDefinition/Solution2/EventsDefinitionTests.cs @@ -34,7 +34,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/Immutable/Solution1/GettingStateFromEventsTests.cs b/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/Immutable/Solution1/GettingStateFromEventsTests.cs index 42231aa27..4dbdcc021 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/Immutable/Solution1/GettingStateFromEventsTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/Immutable/Solution1/GettingStateFromEventsTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/Immutable/Solution2/GettingStateFromEventsTests.cs b/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/Immutable/Solution2/GettingStateFromEventsTests.cs index 331baf788..c8732f741 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/Immutable/Solution2/GettingStateFromEventsTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/Immutable/Solution2/GettingStateFromEventsTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/Mutable/GettingStateFromEventsTests.cs b/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/Mutable/GettingStateFromEventsTests.cs index af4a96aca..41899a736 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/Mutable/GettingStateFromEventsTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/Mutable/GettingStateFromEventsTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/03-AppendingEvents.Marten/AppendingEvents.cs b/Workshops/IntroductionToEventSourcing/Solved/03-AppendingEvents.Marten/AppendingEvents.cs index 507f8c87c..94011c798 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/03-AppendingEvents.Marten/AppendingEvents.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/03-AppendingEvents.Marten/AppendingEvents.cs @@ -34,7 +34,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/04-AppendingEvents.EventStoreDB/AppendingEvents.cs b/Workshops/IntroductionToEventSourcing/Solved/04-AppendingEvents.EventStoreDB/AppendingEvents.cs index 74c87869f..7cd9ea613 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/04-AppendingEvents.EventStoreDB/AppendingEvents.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/04-AppendingEvents.EventStoreDB/AppendingEvents.cs @@ -34,7 +34,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/Immutable/GettingStateFromEventsTests.cs b/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/Immutable/GettingStateFromEventsTests.cs index 2230bbf2b..e6b667b54 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/Immutable/GettingStateFromEventsTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/Immutable/GettingStateFromEventsTests.cs @@ -34,7 +34,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } @@ -60,7 +60,7 @@ public record ShoppingCart( opened.ShoppingCartId, opened.ClientId, ShoppingCartStatus.Pending, - Array.Empty() + [] ); public ShoppingCart Apply(ProductItemAddedToShoppingCart productItemAdded) => diff --git a/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/Mutable/GettingStateFromEventsTests.cs b/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/Mutable/GettingStateFromEventsTests.cs index 6d8af803e..c2ad08fd3 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/Mutable/GettingStateFromEventsTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/Mutable/GettingStateFromEventsTests.cs @@ -34,7 +34,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/Immutable/GettingStateFromEventsTests.cs b/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/Immutable/GettingStateFromEventsTests.cs index 88e063fbd..616202b85 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/Immutable/GettingStateFromEventsTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/Immutable/GettingStateFromEventsTests.cs @@ -35,7 +35,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } @@ -57,7 +57,7 @@ public record ShoppingCart( ) { public static ShoppingCart Default() => - new (default, default, default, Array.Empty()); + new (default, default, default, []); public static ShoppingCart When(ShoppingCart shoppingCart, object @event) { diff --git a/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/Mutable/GettingStateFromEventsTests.cs b/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/Mutable/GettingStateFromEventsTests.cs index 9e6828070..c23570348 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/Mutable/GettingStateFromEventsTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/Mutable/GettingStateFromEventsTests.cs @@ -35,7 +35,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Immutable/BusinessLogic.cs b/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Immutable/BusinessLogic.cs index df88c356f..8200657dc 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Immutable/BusinessLogic.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Immutable/BusinessLogic.cs @@ -13,7 +13,7 @@ public record ShoppingCart( { public bool IsClosed => ShoppingCartStatus.Closed.HasFlag(Status); public static ShoppingCart Default() => - new (default, default, default, Array.Empty()); + new (default, default, default, []); public static ShoppingCart When(ShoppingCart shoppingCart, object @event) { diff --git a/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Immutable/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Immutable/BusinessLogicTests.cs index 29bb9402d..9dd69963b 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Immutable/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Immutable/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Mutable/Solution1/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Mutable/Solution1/BusinessLogicTests.cs index 13574e287..427c3491d 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Mutable/Solution1/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Mutable/Solution1/BusinessLogicTests.cs @@ -31,7 +31,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Mutable/Solution2/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Mutable/Solution2/BusinessLogicTests.cs index 7b40ec5d6..7db3000dc 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Mutable/Solution2/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/Mutable/Solution2/BusinessLogicTests.cs @@ -31,7 +31,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution1/BusinessLogic.cs b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution1/BusinessLogic.cs index 6ffd2f974..8a61990f1 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution1/BusinessLogic.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution1/BusinessLogic.cs @@ -17,7 +17,7 @@ public record ShoppingCart( opened.ShoppingCartId, opened.ClientId, ShoppingCartStatus.Pending, - Array.Empty() + [] ); public ShoppingCart Apply(ProductItemAddedToShoppingCart productItemAdded) => diff --git a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution1/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution1/BusinessLogicTests.cs index 2ad6e1be6..7367fb3f2 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution1/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution1/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution2/ShoppingCart.cs b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution2/ShoppingCart.cs index bf916cfcd..aafa69363 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution2/ShoppingCart.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution2/ShoppingCart.cs @@ -29,7 +29,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } @@ -49,7 +49,7 @@ public record ShoppingCart( opened.ShoppingCartId, opened.ClientId, ShoppingCartStatus.Pending, - Array.Empty() + [] ); public ShoppingCart Apply(ProductItemAddedToShoppingCart productItemAdded) => diff --git a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution3/ShoppingCart.cs b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution3/ShoppingCart.cs index 237debaaa..5319b0931 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution3/ShoppingCart.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution3/ShoppingCart.cs @@ -14,7 +14,7 @@ public record Confirmed(DateTimeOffset ConfirmedAt): ShoppingCartEvent; public record Canceled(DateTimeOffset CanceledAt): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } @@ -36,7 +36,7 @@ public record Pending((ProductId ProductId, int Quantity)[] ProductItems): Shopp public record Closed: ShoppingCart; public static ShoppingCart Create(Opened opened) => - new Pending(Array.Empty<(ProductId ProductId, int Quantity)>()); + new Pending([]); public ShoppingCart Apply(ProductItemAdded productItemAdded) => this is Pending pending diff --git a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution4/ShoppingCart.cs b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution4/ShoppingCart.cs index ab598da55..f7bd86c23 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution4/ShoppingCart.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Immutable/Solution4/ShoppingCart.cs @@ -14,7 +14,7 @@ public record Confirmed(DateTimeOffset ConfirmedAt): ShoppingCartEvent; public record Canceled(DateTimeOffset CanceledAt): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } @@ -39,7 +39,7 @@ public record Closed: ShoppingCart; @event switch { Opened => - new Pending(Array.Empty<(ProductId ProductId, int Quantity)>()), + new Pending([]), ProductItemAdded (var (productId, quantity, _)) => this is Pending pending diff --git a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Mixed/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Mixed/BusinessLogicTests.cs index 687d866dc..13e60c195 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Mixed/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Mixed/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Mutable/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Mutable/BusinessLogicTests.cs index 1854e79d1..6a4e543ae 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Mutable/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/Mutable/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogic.cs b/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogic.cs index 85833ce04..b530350cb 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogic.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogic.cs @@ -14,7 +14,7 @@ public record ShoppingCart( public bool IsClosed => ShoppingCartStatus.Closed.HasFlag(Status); public static ShoppingCart Default() => - new (default, default, default, Array.Empty()); + new (default, default, default, []); public static string StreamName(Guid id) => $"shopping_cart-{id}"; diff --git a/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogicTests.cs index e181b67f4..9d3073cdf 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Immutable/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Mixed/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Mixed/BusinessLogicTests.cs index f9d38495b..02d68b333 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Mixed/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Mixed/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Mutable/BusinessLogicTests.cs b/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Mutable/BusinessLogicTests.cs index 3dcb743ac..319dd6e81 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Mutable/BusinessLogicTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/Mutable/BusinessLogicTests.cs @@ -32,7 +32,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Immutable/BusinessLogic.cs b/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Immutable/BusinessLogic.cs index ac3e5b15c..afab8942c 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Immutable/BusinessLogic.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Immutable/BusinessLogic.cs @@ -17,7 +17,7 @@ public record ShoppingCart( opened.ShoppingCartId, opened.ClientId, ShoppingCartStatus.Pending, - Array.Empty() + [] ); public ShoppingCart Apply(ProductItemAddedToShoppingCart productItemAdded) => diff --git a/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Immutable/OptimisticConcurrencyTests.cs b/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Immutable/OptimisticConcurrencyTests.cs index 2faaed26b..657ab982d 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Immutable/OptimisticConcurrencyTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Immutable/OptimisticConcurrencyTests.cs @@ -33,7 +33,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Mixed/OptimisticConcurrencyTests.cs b/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Mixed/OptimisticConcurrencyTests.cs index d278521fe..84e7be4d2 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Mixed/OptimisticConcurrencyTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Mixed/OptimisticConcurrencyTests.cs @@ -33,7 +33,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Mutable/OptimisticConcurrencyTests.cs b/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Mutable/OptimisticConcurrencyTests.cs index d65025933..fc603d2d7 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Mutable/OptimisticConcurrencyTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/Mutable/OptimisticConcurrencyTests.cs @@ -33,7 +33,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Immutable/BusinessLogic.cs b/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Immutable/BusinessLogic.cs index 8519ab9fc..caa81cc71 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Immutable/BusinessLogic.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Immutable/BusinessLogic.cs @@ -13,7 +13,7 @@ public record ShoppingCart( { public bool IsClosed => ShoppingCartStatus.Closed.HasFlag(Status); public static ShoppingCart Default() => - new (default, default, default, Array.Empty()); + new (default, default, default, []); public static string StreamName(Guid id) => $"shopping_cart-{id}"; diff --git a/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Immutable/OptimisticConcurrencyTests.cs b/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Immutable/OptimisticConcurrencyTests.cs index 8670e1890..54ed1dcca 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Immutable/OptimisticConcurrencyTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Immutable/OptimisticConcurrencyTests.cs @@ -33,7 +33,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Mixed/OptimisticConcurrencyTests.cs b/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Mixed/OptimisticConcurrencyTests.cs index 22cb43654..34b7119c6 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Mixed/OptimisticConcurrencyTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Mixed/OptimisticConcurrencyTests.cs @@ -33,7 +33,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} } diff --git a/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Mutable/OptimisticConcurrencyTests.cs b/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Mutable/OptimisticConcurrencyTests.cs index 649b6aaa0..cdb190946 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Mutable/OptimisticConcurrencyTests.cs +++ b/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/Mutable/OptimisticConcurrencyTests.cs @@ -33,7 +33,7 @@ public record ShoppingCartCanceled( DateTime CanceledAt ): ShoppingCartEvent; - // This won't allow + // This won't allow external inheritance private ShoppingCartEvent(){} }