-
-
Save sulmar/7283309bed4b8e846fe620232699dcd3 to your computer and use it in GitHub Desktop.
This file contains 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
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