We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa26049 commit 91b5d4bCopy full SHA for 91b5d4b
src/JsonApiDotNetCore/Extensions/TypeExtensions.cs
@@ -35,12 +35,12 @@ public static Type GetElementType(this IEnumerable enumerable)
35
/// <summary>
36
/// Creates a List{TInterface} where TInterface is the generic for type specified by t
37
/// </summary>
38
- public static List<TInterface> GetEmptyCollection<TInterface>(this Type t)
+ public static IEnumerable<TInterface> GetEmptyCollection<TInterface>(this Type t)
39
{
40
if (t == null) throw new ArgumentNullException(nameof(t));
41
42
var listType = typeof(List<>).MakeGenericType(t);
43
- var list = (List<TInterface>)Activator.CreateInstance(listType);
+ var list = (IEnumerable<TInterface>)Activator.CreateInstance(listType);
44
return list;
45
}
46
0 commit comments