private static void EuroStandartsSeeding() { var json = File.ReadAllText("CarEuroStandartJsonImporterFile.json"); var properties = JsonSerializer.Deserialize <IEnumerable <FuelTypeDto> >(json); var db = new CarDealerDbContext(); ICarsService carservice = new CarsService(db); foreach (var property in properties) { try { carservice.AddEuroStandart(property.Name); } catch { } } }