public static City KontrolliereMitDatenbank(City stadt, List<City> städte) { foreach (var city in städte) { if (stadt.PostalCode.Equals(city.PostalCode) && !stadt.Name.Equals(city.Name) || !stadt.PostalCode.Equals(city.PostalCode) && stadt.Name.Equals(city.Name)) { throw new WrongCityPostalCodeCombination("Stadt mit PLZ: "+city.PostalCode+" Name: "+city.Name+" ist bereits vorhanden."); } if (stadt.PostalCode == city.PostalCode && stadt.Name.Equals(city.Name)) return city; } return stadt; }
private City GetCorrespondingItemFromDatabase(City city) { return null; }
public Address() { street = ""; streetNumber = ""; city = new City(); }