@@ -122,7 +122,7 @@ public object? this[CloudEventAttribute attribute]
122122 get
123123 {
124124 Validation . CheckNotNull ( attribute , nameof ( attribute ) ) ;
125- Validation . CheckArgument ( attribute . Name != CloudEventsSpecVersion . SpecVersionAttributeName , nameof ( attribute ) , Strings . ErrorCannotIndexBySpecVersionAttribute ) ;
125+ Validation . CheckArgument ( attribute . Name != CloudEventsSpecVersion . SpecVersionAttributeName , nameof ( attribute ) , ( ) => Strings . ErrorCannotIndexBySpecVersionAttribute ) ;
126126
127127 // TODO: Is this validation definitely useful? It does mean we never return something
128128 // that's invalid for the attribute, which is potentially good...
@@ -136,7 +136,7 @@ public object? this[CloudEventAttribute attribute]
136136 set
137137 {
138138 Validation . CheckNotNull ( attribute , nameof ( attribute ) ) ;
139- Validation . CheckArgument ( attribute . Name != CloudEventsSpecVersion . SpecVersionAttributeName , nameof ( attribute ) , Strings . ErrorCannotIndexBySpecVersionAttribute ) ;
139+ Validation . CheckArgument ( attribute . Name != CloudEventsSpecVersion . SpecVersionAttributeName , nameof ( attribute ) , ( ) => Strings . ErrorCannotIndexBySpecVersionAttribute ) ;
140140
141141 string name = attribute . Name ;
142142 var knownAttribute = GetAttribute ( name ) ;
@@ -181,13 +181,13 @@ public object? this[string attributeName]
181181 {
182182 // TODO: Validate the attribute name is valid (e.g. not upper case)? Seems overkill.
183183 Validation . CheckNotNull ( attributeName , nameof ( attributeName ) ) ;
184- Validation . CheckArgument ( attributeName != CloudEventsSpecVersion . SpecVersionAttributeName , nameof ( attributeName ) , Strings . ErrorCannotIndexBySpecVersionAttribute ) ;
184+ Validation . CheckArgument ( attributeName != CloudEventsSpecVersion . SpecVersionAttributeName , nameof ( attributeName ) , ( ) => Strings . ErrorCannotIndexBySpecVersionAttribute ) ;
185185 return attributeValues . GetValueOrDefault ( Validation . CheckNotNull ( attributeName , nameof ( attributeName ) ) ) ;
186186 }
187187 set
188188 {
189189 Validation . CheckNotNull ( attributeName , nameof ( attributeName ) ) ;
190- Validation . CheckArgument ( attributeName != CloudEventsSpecVersion . SpecVersionAttributeName , nameof ( attributeName ) , Strings . ErrorCannotIndexBySpecVersionAttribute ) ;
190+ Validation . CheckArgument ( attributeName != CloudEventsSpecVersion . SpecVersionAttributeName , nameof ( attributeName ) , ( ) => Strings . ErrorCannotIndexBySpecVersionAttribute ) ;
191191
192192 var knownAttribute = GetAttribute ( attributeName ) ;
193193
0 commit comments