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.
2 parents 1e486f4 + ade1c64 commit 3fe0a7bCopy full SHA for 3fe0a7b
src/WebApiContrib.Core.Formatter.Csv/CsvOutputFormatter.cs
@@ -43,15 +43,10 @@ protected override bool CanWriteType(Type type)
43
44
private bool IsTypeOfIEnumerable(Type type)
45
{
46
-
47
- foreach (Type interfaceType in type.GetInterfaces())
48
- {
49
50
- if (interfaceType == typeof(IList))
51
- return true;
52
- }
53
54
- return false;
+ if (type == null)
+ throw new ArgumentNullException("type");
+
+ return typeof(IEnumerable).IsAssignableFrom(type);
55
}
56
57
/// <summary>
0 commit comments