Skip to content

Instantly share code, notes, and snippets.

@sulmar
Created April 11, 2017 07:33
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 sulmar/7283309bed4b8e846fe620232699dcd3 to your computer and use it in GitHub Desktop.
Save sulmar/7283309bed4b8e846fe620232699dcd3 to your computer and use it in GitHub Desktop.
void Main()
{
string json = @"{
'Name': 'Bad Boys',
'ReleaseDate': '1995-4-7T00:00:00',
'Genres': [
'Action',
'Comedy'
]
}";
Movie m = JsonConvert.DeserializeObject<Movie>(json);
string name = m.Name;
}
class Movie
{
public string Name { get; set; }
public DateTime ReleaseDate { get; set; }
public ICollection<string> Genres { get; set; }
public Movie(string name, DateTime releaseDate)
{
this.Name = name;
this.ReleaseDate = releaseDate;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment