@@ -111,24 +111,33 @@ public record StartOrchestrationOptions(string? InstanceId = null, DateTimeOffse
111111 /// Returns a new <see cref="StartOrchestrationOptions"/> with the provided tags added to the existing tags.
112112 /// </summary>
113113 /// <param name="tags">The tags to add.</param>
114- /// <returns>A new <see cref="StartOrchestrationOptions"/> with the combined tags.</returns>
115- public StartOrchestrationOptions AddTags ( IEnumerable < KeyValuePair < string , string > > tags )
114+ public void AddTags ( IEnumerable < KeyValuePair < string , string > > tags )
116115 {
117116 var currentTags = this . Tags as System . Collections . Immutable . ImmutableDictionary < string , string >
118117 ?? System . Collections . Immutable . ImmutableDictionary . Create < string , string > ( ) ;
119- return this with { Tags = currentTags . AddRange ( tags ) } ;
118+ this . Tags = currentTags . AddRange ( tags ) ;
120119 }
121120
122121 /// <summary>
123122 /// Returns a new <see cref="StartOrchestrationOptions"/> with the provided tag added to the existing tags.
124123 /// </summary>
125124 /// <param name="key">The tag key.</param>
126125 /// <param name="value">The tag value.</param>
127- /// <returns>A new <see cref="StartOrchestrationOptions"/> with the combined tags.</returns>
128- public StartOrchestrationOptions AddTag ( string key , string value )
126+ public void AddTag ( string key , string value )
129127 {
128+ if ( string . IsNullOrEmpty ( key ) )
129+ {
130+ throw new ArgumentException ( "Tag key cannot be null or empty." , nameof ( key ) ) ;
131+ }
132+
133+ if ( string . IsNullOrEmpty ( value ) )
134+ {
135+ throw new ArgumentException ( "Tag value cannot be null or empty." , nameof ( value ) ) ;
136+ }
137+
130138 var currentTags = this . Tags as System . Collections . Immutable . ImmutableDictionary < string , string >
131139 ?? System . Collections . Immutable . ImmutableDictionary . Create < string , string > ( ) ;
132- return this with { Tags = currentTags . Add ( key , value ) } ;
140+
141+ this . Tags = currentTags . Add ( key , value ) ;
133142 }
134143}
0 commit comments