Created
September 13, 2022 15:50
-
-
Save jskeet/badd19537b14588ce465a0259598135d to your computer and use it in GitHub Desktop.
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
using Newtonsoft.Json; | |
class Data | |
{ | |
public string Title { get; set; } | |
public DateTime SomeTimestamp { get; set; } | |
public List<int> Numbers { get; set; } = new List<int>(); | |
} | |
class Program | |
{ | |
static void Main() | |
{ | |
Data data = JsonConvert.DeserializeObject<Data>("{\"title\":\"some title\",\"timestamp\":\"2022-01-01T00:00:00.000Z\",\"numbers\":[1,2,3]}"); | |
Console.WriteLine($"Title: {data.Title}"); | |
Console.WriteLine($"SomeTimestamp: {data.SomeTimestamp}"); | |
Console.WriteLine($"Numbers: {string.Join(", ", data.Numbers)}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment