Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit f0eb397

Browse files
committed
Properly fix build errors.
1 parent 11688dd commit f0eb397

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/ServiceStack.Text/ReflectionExtensions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ public static List<Attribute> GetAttributes(this PropertyInfo propertyInfo, Type
11271127
List<Attribute> propertyAttrs;
11281128
return !propertyAttributesMap.TryGetValue(propertyInfo.UniqueKey(), out propertyAttrs)
11291129
? new List<Attribute>()
1130-
: propertyAttrs.Where(attrType.IsInstanceOfType).ToList();
1130+
: propertyAttrs.Where(x => attrType.IsInstanceOf(x.GetType()) ).ToList();
11311131
}
11321132

11331133
public static object[] AllAttributes(this PropertyInfo propertyInfo)
@@ -1148,7 +1148,7 @@ public static object[] AllAttributes(this PropertyInfo propertyInfo)
11481148
public static object[] AllAttributes(this PropertyInfo propertyInfo, Type attrType)
11491149
{
11501150
#if (NETFX_CORE || PCL)
1151-
return propertyInfo.GetCustomAttributes(true).Where(attrType.IsInstanceOf).ToArray();
1151+
return propertyInfo.GetCustomAttributes(true).Where(x => attrType.IsInstanceOf(x.GetType())).ToArray();
11521152
#else
11531153
var attrs = propertyInfo.GetCustomAttributes(attrType, true);
11541154
var runtimeAttrs = propertyInfo.GetAttributes(attrType);
@@ -1190,7 +1190,7 @@ public static object[] AllAttributes(this MemberInfo memberInfo)
11901190
public static object[] AllAttributes(this ParameterInfo paramInfo, Type attrType)
11911191
{
11921192
#if (NETFX_CORE || PCL)
1193-
return paramInfo.GetCustomAttributes(true).Where(attrType.IsInstanceOf).ToArray();
1193+
return paramInfo.GetCustomAttributes(true).Where(x => attrType.IsInstanceOf(x.GetType())).ToArray();
11941194
#else
11951195
return paramInfo.GetCustomAttributes(attrType, true);
11961196
#endif
@@ -1199,7 +1199,7 @@ public static object[] AllAttributes(this ParameterInfo paramInfo, Type attrType
11991199
public static object[] AllAttributes(this MemberInfo memberInfo, Type attrType)
12001200
{
12011201
#if (NETFX_CORE || PCL)
1202-
return memberInfo.GetCustomAttributes(true).Where(attrType.IsInstanceOf).ToArray();
1202+
return memberInfo.GetCustomAttributes(true).Where(x => attrType.IsInstanceOf(x.GetType())).ToArray();
12031203
#else
12041204
return memberInfo.GetCustomAttributes(attrType, true);
12051205
#endif
@@ -1208,7 +1208,7 @@ public static object[] AllAttributes(this MemberInfo memberInfo, Type attrType)
12081208
public static object[] AllAttributes(this FieldInfo fieldInfo, Type attrType)
12091209
{
12101210
#if (NETFX_CORE || PCL)
1211-
return fieldInfo.GetCustomAttributes(true).Where(attrType.IsInstanceOf).ToArray();
1211+
return fieldInfo.GetCustomAttributes(true).Where(x => attrType.IsInstanceOf(x.GetType())).ToArray();
12121212
#else
12131213
return fieldInfo.GetCustomAttributes(attrType, true);
12141214
#endif
@@ -1226,7 +1226,7 @@ public static object[] AllAttributes(this Type type)
12261226
public static object[] AllAttributes(this Type type, Type attrType)
12271227
{
12281228
#if (NETFX_CORE || PCL)
1229-
return type.GetTypeInfo().GetCustomAttributes(true).Where(attrType.IsInstanceOf).ToArray();
1229+
return type.GetTypeInfo().GetCustomAttributes(true).Where(x => attrType.IsInstanceOf(x.GetType())).ToArray();
12301230
#else
12311231
return type.GetCustomAttributes(true).Union(type.GetRuntimeAttributes()).ToArray();
12321232
#endif
@@ -1273,7 +1273,7 @@ static IEnumerable<Attribute> GetRuntimeAttributes(this Type type, Type attrType
12731273
{
12741274
List<Attribute> attrs;
12751275
return typeAttributesMap.TryGetValue(type, out attrs)
1276-
? attrs.Where(x => attrType == null || attrType.IsInstanceOfType(x))
1276+
? attrs.Where(x => attrType == null || attrType.IsInstanceOf(x.GetType()))
12771277
: new List<Attribute>();
12781278
}
12791279

0 commit comments

Comments
 (0)