Skip to content

Commit 2e17c12

Browse files
committed
fix(TypeExtensions): use netstandard1.x reflection methods
1 parent 3d6aaf6 commit 2e17c12

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/JsonApiDotNetCore/Extensions/TypeExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections;
33
using System.Collections.Generic;
44
using System.Linq;
5+
using System.Reflection;
56

67
namespace JsonApiDotNetCore.Extensions
78
{
@@ -10,8 +11,9 @@ internal static class TypeExtensions
1011
public static Type GetElementType(this IEnumerable enumerable)
1112
{
1213
var enumerableTypes = enumerable.GetType()
14+
.GetTypeInfo()
1315
.GetInterfaces()
14-
.Where(t => t.IsGenericType == true && t.GetGenericTypeDefinition() == typeof(IEnumerable<>))
16+
.Where(t => t.GetTypeInfo().IsGenericType == true && t.GetGenericTypeDefinition() == typeof(IEnumerable<>))
1517
.ToList();
1618

1719
var numberOfEnumerableTypes = enumerableTypes.Count;

0 commit comments

Comments
 (0)