Skip to content

Instantly share code, notes, and snippets.

Created April 30, 2014 02:58
Show Gist options
  • Save anonymous/08472229639cee9eb613 to your computer and use it in GitHub Desktop.
Save anonymous/08472229639cee9eb613 to your computer and use it in GitHub Desktop.
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
[JsonObject()]
public class Unnamed
{
public Team team { get; set; }
}
[JsonObject("team")]
public class Team
{
[JsonProperty("international_date")]
public bool InternationalDate { get; set; }
[JsonProperty("is_coed")]
public bool IsCoed { get; set; }
[JsonProperty("team_name")]
public string TeamName { get; set; }
}
class Program
{
static void Main(string[] args)
{
string s = "[{team: {international_date: false,is_coed: false,team_name: 'foo bar'} }, { team: { international_date: false, is_coed: false,team_name: 'foo bar'}}]";
Unnamed[] un = Newtonsoft.Json.JsonConvert.DeserializeObject<Unnamed[]>(s);
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment