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

Commit b55fad6

Browse files
committed
Make ICollection behave the same a IEnumerable
1 parent f62abce commit b55fad6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ServiceStack.Text/Common/JsWriter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ private WriteObjectDelegate GetCoreWriteFn<T>()
413413
}
414414
}
415415

416-
var isDictionary = typeof(T) != typeof(IEnumerable)
416+
var isDictionary = typeof(T) != typeof(IEnumerable) && typeof(T) != typeof(ICollection)
417417
&& (typeof(T).AssignableFrom(typeof(IDictionary)) || typeof(T).HasInterface(typeof(IDictionary)));
418418
if (isDictionary)
419419
{
@@ -462,4 +462,4 @@ public void WriteType(TextWriter writer, object value)
462462
}
463463

464464
}
465-
}
465+
}

0 commit comments

Comments
 (0)