public static void Initialize(CookingBookContext context) { if (!context.Recipes.Any()) { var seedDataFile = File.ReadAllText("Resources/SeedData.json"); var seedDataJson = JObject.Parse(seedDataFile); var recipes = JsonConvert.DeserializeObject <List <Recipe> >(seedDataJson["recipes"].ToString()); context.Recipes.AddRange(recipes); context.SaveChanges(); } }