示例#1
0
        public static CityViewModel CityFromDtoToView(CityDTO cityDTO)
        {
            CityViewModel cityVM = new CityViewModel
            {
                CityId     = cityDTO.CityId,
                CityName   = cityDTO.CityName,
                CountryId  = cityDTO.CountryId,
                Population = cityDTO.Population
            };

            return(cityVM);
        }
示例#2
0
        public static CityDTO CityFromViewToDto(CityViewModel cvm)
        {
            CityDTO cityDto = new CityDTO
            {
                CityId     = cvm.CityId,
                CityName   = cvm.CityName,
                CountryId  = cvm.CountryId,
                Population = cvm.Population
            };

            return(cityDto);
        }