Skip to content

Instantly share code, notes, and snippets.

@Dillie-O
Created March 11, 2019 23:52
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 Dillie-O/61435a7ce51ac14af68ed019223a3bd7 to your computer and use it in GitHub Desktop.
Save Dillie-O/61435a7ce51ac14af68ed019223a3bd7 to your computer and use it in GitHub Desktop.
[Parse JSON into List] Parse JSON into List<T> #dotnetcore
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