예제 #1
0
        private static void MakesSeeding()
        {
            var json = File.ReadAllText("CarMakesJsonImporterFile.json");

            var properties = JsonSerializer.Deserialize <IEnumerable <MakeDto> >(json);

            ICarsService carsService = new CarsService(db);

            foreach (var property in properties)
            {
                try
                {
                    carsService.AddMake(property.Name);
                }
                catch
                {
                }
            }
        }