From 1caba6ddd6f878548fc9e6b8064ae11b071fc3e4 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Sun, 25 Feb 2024 13:33:38 +0100 Subject: [PATCH] Normalize collections in WorkflowManagementFeature This commit ensures uniqueness within the 'ActivityTypes' and 'VariableDescriptors' collections in the WorkflowManagementFeature. 'ActivityTypes' has been updated to only add distinct activity types, and 'VariableDescriptors' has been refined to only add descriptors with unique 'Type' properties. --- .../Features/WorkflowManagementFeature.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs b/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs index b9a04daee..6944584b2 100644 --- a/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs +++ b/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs @@ -202,10 +202,10 @@ public class WorkflowManagementFeature : FeatureBase Services.Configure(options => { - foreach (var activityType in ActivityTypes) + foreach (var activityType in ActivityTypes.Distinct()) options.ActivityTypes.Add(activityType); - foreach (var descriptor in VariableDescriptors) + foreach (var descriptor in VariableDescriptors.DistinctBy(x => x.Type)) options.VariableDescriptors.Add(descriptor); options.CompressionAlgorithm = CompressionAlgorithm;