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