diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs index 8141be1075..bee9947a6b 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs @@ -40,8 +40,7 @@ public sealed class SwitchBuilder foreach (ExecutorBinding executor in executors) { - Throw.IfNull(executor, $"{nameof(executors)}[{executorIndex}]"); - executorIndex++; + Throw.IfNull(executor, $"{nameof(executors)}[{executorIndex++}]"); if (!this._executorIndicies.TryGetValue(executor.Id, out int index)) { @@ -72,8 +71,7 @@ public sealed class SwitchBuilder foreach (ExecutorBinding executor in executors) { - Throw.IfNull(executor, $"{nameof(executors)}[{executorIndex}]"); - executorIndex++; + Throw.IfNull(executor, $"{nameof(executors)}[{executorIndex++}]"); if (!this._executorIndicies.TryGetValue(executor.Id, out int index)) { diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowBuilderExtensions.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowBuilderExtensions.cs index 41cceb25a3..a22aa8e722 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowBuilderExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowBuilderExtensions.cs @@ -62,7 +62,7 @@ public static class WorkflowBuilderExtensions Func predicate = WorkflowBuilder.CreateConditionFunc(IsAllowedTypeAndMatchingCondition)!; -#if NET6_0_OR_GREATER +#if NET if (targets.TryGetNonEnumeratedCount(out int count) && count == 1) #else if (targets is ICollection { Count: 1 }) @@ -111,7 +111,7 @@ public static class WorkflowBuilderExtensions Func predicate = WorkflowBuilder.CreateConditionFunc((Func)IsAllowedType)!; -#if NET6_0_OR_GREATER +#if NET if (targets.TryGetNonEnumeratedCount(out int count) && count == 1) #else if (targets is ICollection { Count: 1 })