File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class TestObject
34
34
35
35
public string AString { get ; }
36
36
public decimal ? ANullableDecimal { get ; }
37
+ public object Unreadable { set => throw new NotImplementedException ( ) ; }
37
38
38
39
public object this [ int index ]
39
40
{
Original file line number Diff line number Diff line change @@ -136,7 +136,8 @@ static IEnumerable<MemberInfo> PrepareMemberInfos<T>(ICollection<Expression<Func
136
136
{
137
137
return from m in typeof ( T ) . GetMembers ( BindingFlags . Public | BindingFlags . Instance )
138
138
where m . MemberType == MemberTypes . Field
139
- || m . MemberType == MemberTypes . Property && ( ( PropertyInfo ) m ) . GetIndexParameters ( ) . Length == 0
139
+ || m is PropertyInfo p && p . CanRead
140
+ && p . GetIndexParameters ( ) . Length == 0
140
141
select m ;
141
142
}
142
143
You can’t perform that action at this time.
0 commit comments