Ejemplo n.º 1
0
 public CountryViewModel(CountryDomainModel country)
 {
     if (country == null)
     {
         throw new ArgumentNullException(nameof(country));
     }
     CountryKey  = country.Key;
     CountryName = country.Name;
 }
Ejemplo n.º 2
0
 public CityViewModel(CountryDomainModel country, CountryDomainModel.City city)
 {
     if (city == null)
     {
         throw new ArgumentNullException(nameof(city));
     }
     IconUrl     = city.IconUrl;
     Description = city.Description;
     CityName    = city.Name;
     CityKey     = city.Key;
     CountryKey  = country.Key;
     CountryName = country.Name;
 }
Ejemplo n.º 3
0
        public ListCitiesResponse(CountryDomainModel country)
        {
            if (country == null)
            {
                throw new ArgumentNullException(nameof(country));
            }
            if (!country.Cities.Any())
            {
                throw new ArgumentNullException(nameof(country.Cities));
            }

            CountryKey  = country.Key;
            CountryName = country.Name;
            Cities      = country.Cities.Select(x => new CityViewModel(country, x)).ToArray();
        }