@@ -144,7 +144,7 @@ public static void SetProperties(in ParameterView parameters, object target)
144144 }
145145 }
146146
147- static void SetProperty ( object target , IPropertySetter writer , string parameterName , object value )
147+ static void SetProperty ( object target , PropertySetter writer , string parameterName , object value )
148148 {
149149 try
150150 {
@@ -246,13 +246,13 @@ private static void ThrowForInvalidCaptureUnmatchedValuesParameterType(Type targ
246246 private class WritersForType
247247 {
248248 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 ;
251251
252252 public WritersForType ( Type targetType )
253253 {
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 ) ;
256256
257257 foreach ( var propertyInfo in GetCandidateBindableProperties ( targetType ) )
258258 {
@@ -271,7 +271,10 @@ public WritersForType(Type targetType)
271271 $ "The type '{ targetType . FullName } ' declares a parameter matching the name '{ propertyName } ' that is not public. Parameters must be public.") ;
272272 }
273273
274- var propertySetter = MemberAssignment . CreatePropertySetter ( targetType , propertyInfo , cascading : cascadingParameterAttribute != null ) ;
274+ var propertySetter = new PropertySetter ( targetType , propertyInfo )
275+ {
276+ Cascading = cascadingParameterAttribute != null ,
277+ } ;
275278
276279 if ( _underlyingWriters . ContainsKey ( propertyName ) )
277280 {
@@ -298,17 +301,17 @@ public WritersForType(Type targetType)
298301 ThrowForInvalidCaptureUnmatchedValuesParameterType ( targetType , propertyInfo ) ;
299302 }
300303
301- CaptureUnmatchedValuesWriter = MemberAssignment . CreatePropertySetter ( targetType , propertyInfo , cascading : false ) ;
304+ CaptureUnmatchedValuesWriter = new PropertySetter ( targetType , propertyInfo ) ;
302305 CaptureUnmatchedValuesPropertyName = propertyInfo . Name ;
303306 }
304307 }
305308 }
306309
307- public IPropertySetter ? CaptureUnmatchedValuesWriter { get ; }
310+ public PropertySetter ? CaptureUnmatchedValuesWriter { get ; }
308311
309312 public string ? CaptureUnmatchedValuesPropertyName { get ; }
310313
311- public bool TryGetValue ( string parameterName , [ MaybeNullWhen ( false ) ] out IPropertySetter writer )
314+ public bool TryGetValue ( string parameterName , [ MaybeNullWhen ( false ) ] out PropertySetter writer )
312315 {
313316 // In intensive parameter-passing scenarios, one of the most expensive things we do is the
314317 // lookup from parameterName to writer. Pre-5.0 that was because of the string hashing.
0 commit comments