@@ -86,24 +86,24 @@ public static IEnumerable<Error> SetProperties<T>(
8686 Func < SpecificationProperty , bool > predicate ,
8787 Func < SpecificationProperty , object > selector )
8888 {
89- return specProps . Where ( predicate ) . SelectMany ( specProp => specProp . Property . SetValue ( instance , selector ( specProp ) ) ) ;
90- }
91-
92- private static IEnumerable < Error > SetValue < T > ( this PropertyInfo property , T instance , object value )
93- {
94- try
95- {
96- property . SetValue ( instance , value , null ) ;
97- return Enumerable . Empty < Error > ( ) ;
98- }
99- catch ( TargetInvocationException e )
100- {
101- return new [ ] { new SetValueExceptionError ( e . InnerException ) } ;
102- }
103- catch ( Exception e )
104- {
105- return new [ ] { new SetValueExceptionError ( e ) } ;
106- }
89+ return specProps . Where ( predicate ) . SelectMany ( specProp => specProp . SetValue ( instance , selector ( specProp ) ) ) ;
90+ }
91+
92+ private static IEnumerable < Error > SetValue < T > ( this SpecificationProperty specProp , T instance , object value )
93+ {
94+ try
95+ {
96+ specProp . Property . SetValue ( instance , value , null ) ;
97+ return Enumerable . Empty < Error > ( ) ;
98+ }
99+ catch ( TargetInvocationException e )
100+ {
101+ return new [ ] { new SetValueExceptionError ( specProp . Specification . FromSpecification ( ) , e . InnerException ) } ;
102+ }
103+ catch ( Exception e )
104+ {
105+ return new [ ] { new SetValueExceptionError ( specProp . Specification . FromSpecification ( ) , e ) } ;
106+ }
107107 }
108108
109109 public static object CreateEmptyArray ( this Type type )
0 commit comments