@@ -144,7 +144,7 @@ public static void SetProperties(in ParameterView parameters, object target)
144
144
}
145
145
}
146
146
147
- static void SetProperty ( object target , IPropertySetter writer , string parameterName , object value )
147
+ static void SetProperty ( object target , PropertySetter writer , string parameterName , object value )
148
148
{
149
149
try
150
150
{
@@ -246,13 +246,13 @@ private static void ThrowForInvalidCaptureUnmatchedValuesParameterType(Type targ
246
246
private class WritersForType
247
247
{
248
248
private const int MaxCachedWriterLookups = 100 ;
249
- private readonly Dictionary < string , IPropertySetter > _underlyingWriters ;
250
- private readonly ConcurrentDictionary < string , IPropertySetter ? > _referenceEqualityWritersCache ;
249
+ private readonly Dictionary < string , PropertySetter > _underlyingWriters ;
250
+ private readonly ConcurrentDictionary < string , PropertySetter ? > _referenceEqualityWritersCache ;
251
251
252
252
public WritersForType ( Type targetType )
253
253
{
254
- _underlyingWriters = new Dictionary < string , IPropertySetter > ( StringComparer . OrdinalIgnoreCase ) ;
255
- _referenceEqualityWritersCache = new ConcurrentDictionary < string , IPropertySetter ? > ( ReferenceEqualityComparer . Instance ) ;
254
+ _underlyingWriters = new Dictionary < string , PropertySetter > ( StringComparer . OrdinalIgnoreCase ) ;
255
+ _referenceEqualityWritersCache = new ConcurrentDictionary < string , PropertySetter ? > ( ReferenceEqualityComparer . Instance ) ;
256
256
257
257
foreach ( var propertyInfo in GetCandidateBindableProperties ( targetType ) )
258
258
{
@@ -271,7 +271,10 @@ public WritersForType(Type targetType)
271
271
$ "The type '{ targetType . FullName } ' declares a parameter matching the name '{ propertyName } ' that is not public. Parameters must be public.") ;
272
272
}
273
273
274
- var propertySetter = MemberAssignment . CreatePropertySetter ( targetType , propertyInfo , cascading : cascadingParameterAttribute != null ) ;
274
+ var propertySetter = new PropertySetter ( targetType , propertyInfo )
275
+ {
276
+ Cascading = cascadingParameterAttribute != null ,
277
+ } ;
275
278
276
279
if ( _underlyingWriters . ContainsKey ( propertyName ) )
277
280
{
@@ -298,17 +301,17 @@ public WritersForType(Type targetType)
298
301
ThrowForInvalidCaptureUnmatchedValuesParameterType ( targetType , propertyInfo ) ;
299
302
}
300
303
301
- CaptureUnmatchedValuesWriter = MemberAssignment . CreatePropertySetter ( targetType , propertyInfo , cascading : false ) ;
304
+ CaptureUnmatchedValuesWriter = new PropertySetter ( targetType , propertyInfo ) ;
302
305
CaptureUnmatchedValuesPropertyName = propertyInfo . Name ;
303
306
}
304
307
}
305
308
}
306
309
307
- public IPropertySetter ? CaptureUnmatchedValuesWriter { get ; }
310
+ public PropertySetter ? CaptureUnmatchedValuesWriter { get ; }
308
311
309
312
public string ? CaptureUnmatchedValuesPropertyName { get ; }
310
313
311
- public bool TryGetValue ( string parameterName , [ MaybeNullWhen ( false ) ] out IPropertySetter writer )
314
+ public bool TryGetValue ( string parameterName , [ MaybeNullWhen ( false ) ] out PropertySetter writer )
312
315
{
313
316
// In intensive parameter-passing scenarios, one of the most expensive things we do is the
314
317
// lookup from parameterName to writer. Pre-5.0 that was because of the string hashing.
0 commit comments