コード例 #1
0
        public static CityDTO CityfromCoreToDto(City city)
        {
            CityDTO cityDto = new CityDTO
            {
                CityId     = city.CityId,
                CityName   = city.CityName,
                CountryId  = city.CountryId,
                Population = city.Population
            };

            return(cityDto);
        }
コード例 #2
0
        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);
        }