From bc4e604ba2c8e28669b05e7e8bd7ee338489d1b3 Mon Sep 17 00:00:00 2001 From: Anne Erdtsieck Date: Fri, 24 Jan 2025 12:14:58 +0100 Subject: [PATCH] #3634 do not validate tenancy mapping of live stream aggregations --- src/DaemonTests/event_projection_scenario_tests.cs | 8 +++----- .../GeneratedAggregateProjectionBase.Validation.cs | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/DaemonTests/event_projection_scenario_tests.cs b/src/DaemonTests/event_projection_scenario_tests.cs index 3b9125923d..0830ac84a1 100644 --- a/src/DaemonTests/event_projection_scenario_tests.cs +++ b/src/DaemonTests/event_projection_scenario_tests.cs @@ -92,7 +92,7 @@ public async Task happy_path_test_with_live_projection_multi_tenanted() await theStore.Advanced.EventProjectionScenario(scenario => { - scenario.Append(Guid.NewGuid(), new CreateUser { UserId = id, UserName = "Kareem" }); + scenario.Append(id, new CreateUser { UserId = id, UserName = "Kareem" }); scenario.DocumentShouldNotExist(id); }); @@ -308,12 +308,10 @@ public class LiveUser public Guid Id { get; set; } public string UserName { get; set; } - public LiveUser Create(CreateUser create) - { - return new LiveUser + public static LiveUser Create(CreateUser create) => + new() { Id = create.UserId, UserName = create.UserName }; - } } diff --git a/src/Marten/Events/Aggregation/GeneratedAggregateProjectionBase.Validation.cs b/src/Marten/Events/Aggregation/GeneratedAggregateProjectionBase.Validation.cs index 15501319da..4e608b2272 100644 --- a/src/Marten/Events/Aggregation/GeneratedAggregateProjectionBase.Validation.cs +++ b/src/Marten/Events/Aggregation/GeneratedAggregateProjectionBase.Validation.cs @@ -26,7 +26,8 @@ internal override IEnumerable ValidateConfiguration(StoreOptions options if (options.Events.TenancyStyle != mapping.TenancyStyle && (options.Events.TenancyStyle == TenancyStyle.Single || options.Events is - { TenancyStyle: TenancyStyle.Conjoined, EnableGlobalProjectionsForConjoinedTenancy: false }) + { TenancyStyle: TenancyStyle.Conjoined, EnableGlobalProjectionsForConjoinedTenancy: false } + && Lifecycle != ProjectionLifecycle.Live) ) { yield return