From 35742ea470a1ab77b8e7415f3507d8f07da8d543 Mon Sep 17 00:00:00 2001 From: Eduardo Pignatelli Date: Tue, 30 Jul 2019 16:52:39 +0100 Subject: [PATCH] Solves #703 --- Reflection_Engine/Query/UnderlyingType.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Reflection_Engine/Query/UnderlyingType.cs b/Reflection_Engine/Query/UnderlyingType.cs index b872cb3b7..7e301357b 100644 --- a/Reflection_Engine/Query/UnderlyingType.cs +++ b/Reflection_Engine/Query/UnderlyingType.cs @@ -39,10 +39,10 @@ public static partial class Query public static UnderlyingType UnderlyingType(this Type type) { int depth = 0; - while (type.GetGenericArguments().Count() == 1 && typeof(IEnumerable).IsAssignableFrom(type)) + while ((type.GetGenericArguments().Count() == 1 || type.GetElementType() != null) && typeof(IEnumerable).IsAssignableFrom(type)) { depth++; - type = type.GetGenericArguments().First(); + type = type.GetElementType() ?? type.GetGenericArguments().First(); } return new UnderlyingType { Type = type, Depth = depth };