Skip to content

Commit

Permalink
Ensure services are copied to new child context in ForEachElement (#6045
Browse files Browse the repository at this point in the history
) (#6046)
  • Loading branch information
EricDahlvang committed Dec 9, 2021
1 parent 91c25e0 commit ec535a3
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ private async Task<DialogTurnResult> RunItemsAsync(DialogContext dc, bool beginD
var childDialogState = GetActionScopeState(dc);
var childDc = new DialogContext(new DialogSet().Add(_scope), dc.Parent ?? dc, childDialogState);
childDc.Parent = dc.Parent;
if (dc.Services != null)
{
foreach (var service in dc.Services)
{
childDc.Services[service.Key] = service.Value;
}
}

dc.State.SetValue(Value.GetValue(dc.State), list[index][IterationValue]);
dc.State.SetValue(Index.GetValue(dc.State), list[index][IterationKey]);
Expand Down

0 comments on commit ec535a3

Please sign in to comment.