Permalink
Browse files

Add support for ISet<T> to TypeCoercionUtility

1 parent 6dd3fa0 commit b4f351deefeb03ca32a987f07a99960a239d245f Ben Herila committed on GitHub Jun 17, 2016
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/JsonFx/Serialization/TypeCoercionUtility.cs
@@ -737,6 +737,11 @@ private static Type ResolveInterfaceType(Type targetType)
Type[] genericArgs = targetType.GetGenericArguments();
targetType = typeof(List<>).MakeGenericType(genericArgs);
}
+ else if (genericType == typeof(ISet<>))
+ {
+ Type[] genericArgs = targetType.GetGenericArguments();
+ targetType = typeof(HashSet<>).MakeGenericType(genericArgs);
+ }
else if (genericType == typeof(IDictionary<,>))
{
Type[] genericArgs = targetType.GetGenericArguments();

3 comments on commit b4f351d

@IliyaNovikov

Hello. With this commit the project won't compile for .Net 3.5. ISet was introduced in .Net version 4.0

@mckamey
Member
mckamey commented on b4f351d Sep 18, 2016 edited

Try wrapping this change in a conditional compilation block:

#if !NET20 && !NET30 && !NET35
....
#endif

If that works for you, send me a PR and I'll merge it in.

@IliyaNovikov

The PR number is #47. Thank you

Please sign in to comment.