@@ -23,7 +23,6 @@ sealed partial class TaskOrchestrationContextWrapper : TaskOrchestrationContext
2323 readonly OrchestrationInvocationContext invocationContext ;
2424 readonly ILogger logger ;
2525 readonly object ? deserializedInput ;
26- readonly Dictionary < string , object ? > properties = new Dictionary < string , object ? > ( ) ;
2726
2827 int newGuidCounter ;
2928 object ? customStatus ;
@@ -39,11 +38,8 @@ public TaskOrchestrationContextWrapper(
3938 OrchestrationContext innerContext ,
4039 OrchestrationInvocationContext invocationContext ,
4140 object ? deserializedInput )
41+ : this ( innerContext , invocationContext , deserializedInput , new Dictionary < string , object ? > ( ) )
4242 {
43- this . innerContext = Check . NotNull ( innerContext ) ;
44- this . invocationContext = Check . NotNull ( invocationContext ) ;
45- this . logger = this . CreateReplaySafeLogger ( "Microsoft.DurableTask" ) ;
46- this . deserializedInput = deserializedInput ;
4743 }
4844
4945 /// <summary>
@@ -57,11 +53,16 @@ public TaskOrchestrationContextWrapper(
5753 OrchestrationContext innerContext ,
5854 OrchestrationInvocationContext invocationContext ,
5955 object ? deserializedInput ,
60- Dictionary < string , object ? > properties )
56+ IEnumerable < KeyValuePair < string , object ? > > properties )
6157 {
6258 this . innerContext = Check . NotNull ( innerContext ) ;
6359 this . invocationContext = Check . NotNull ( invocationContext ) ;
64- this . properties = Check . NotNull ( properties ) ;
60+ if ( properties is null )
61+ {
62+ throw new ArgumentNullException ( nameof ( properties ) ) ;
63+ }
64+
65+ this . Properties = properties . ToDictionary ( pair => pair . Key , pair => pair . Value ) ;
6566 this . logger = this . CreateReplaySafeLogger ( "Microsoft.DurableTask" ) ;
6667 this . deserializedInput = deserializedInput ;
6768 }
@@ -84,7 +85,7 @@ public TaskOrchestrationContextWrapper(
8485 /// <summary>
8586 /// Gets the configuration settings for the orchestration.
8687 /// </summary>
87- public override IDictionary < string , object ? > Properties => this . properties ;
88+ public override IDictionary < string , object ? > Properties { get ; } = new Dictionary < string , object ? > ( ) ;
8889
8990 /// <inheritdoc/>
9091 public override TaskOrchestrationEntityFeature Entities
0 commit comments