public static CityDTO CityfromCoreToDto(City city) { CityDTO cityDto = new CityDTO { CityId = city.CityId, CityName = city.CityName, CountryId = city.CountryId, Population = city.Population }; return(cityDto); }
public static City CityFromDtoToCore(CityDTO cityDto) { City city = new City(); if (cityDto != null) { city.CityId = cityDto.CityId; city.CityName = cityDto.CityName; city.CountryId = cityDto.CountryId; city.Population = cityDto.Population; } return(city); }