Skip to content

Instantly share code, notes, and snippets.

@Meligy
Created May 10, 2011 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Meligy/964391 to your computer and use it in GitHub Desktop.
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
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