@@ -122,7 +122,7 @@ public object? this[CloudEventAttribute attribute]
122
122
get
123
123
{
124
124
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 ) ;
126
126
127
127
// TODO: Is this validation definitely useful? It does mean we never return something
128
128
// that's invalid for the attribute, which is potentially good...
@@ -136,7 +136,7 @@ public object? this[CloudEventAttribute attribute]
136
136
set
137
137
{
138
138
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 ) ;
140
140
141
141
string name = attribute . Name ;
142
142
var knownAttribute = GetAttribute ( name ) ;
@@ -181,13 +181,13 @@ public object? this[string attributeName]
181
181
{
182
182
// TODO: Validate the attribute name is valid (e.g. not upper case)? Seems overkill.
183
183
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 ) ;
185
185
return attributeValues . GetValueOrDefault ( Validation . CheckNotNull ( attributeName , nameof ( attributeName ) ) ) ;
186
186
}
187
187
set
188
188
{
189
189
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 ) ;
191
191
192
192
var knownAttribute = GetAttribute ( attributeName ) ;
193
193
0 commit comments