private Dealer AddDealer(JsonCar car) { var cityToAdd = this.databaseContext.Cities.FirstOrDefault(city => city.Name.Equals(car.Dealer.City)) ?? new City { Name = car.Dealer.City }; return new Dealer { Name = car.Dealer.Name, City = cityToAdd }; }
private Manufacturer AddManufacturer(JsonCar car) { return this.databaseContext.Manufacturers.FirstOrDefault(man => man.Name.Equals(car.ManufacturerName)) ?? new Manufacturer { Name = car.ManufacturerName }; }