Created
March 11, 2019 23:52
-
-
Save Dillie-O/61435a7ce51ac14af68ed019223a3bd7 to your computer and use it in GitHub Desktop.
[Parse JSON into List] Parse JSON into List<T> #dotnetcore
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
using System.Collections.Generic; | |
using System.IO; | |
using Newtonsoft.Json; | |
var pathToSeedData = Path.Combine(Directory.GetCurrentDirectory(), "Data", "duck_seed.json"); | |
var dataSet = File.ReadAllText(pathToSeedData); | |
var seedData = JsonConvert.DeserializeObject<List<Duck>>(dataSet); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment