Created
May 10, 2011 12:38
-
-
Save Meligy/964391 to your computer and use it in GitHub Desktop.
A simple way to resolve ISet<> interface from JSon string as HashSet<> object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SampleJson | |
{ | |
using Newtonsoft.Json.Converters; | |
using System.Collections.Generic; | |
internal class SetConverter<T> : CustomCreationConverter<ISet<T>> | |
{ | |
public override ISet<T> Create(Type objectType) | |
{ | |
return new HashSet<T>(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment