Пример #1
0
        /// <summary>
        /// Retrieve the CountryViewModel
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public virtual async Task <CountryViewModel> RetrieveCountryAsync(RetrieveCountryParam param)
        {
            if (string.IsNullOrWhiteSpace(param.IsoCode))
            {
                throw new ArgumentException(ArgumentNullMessageFormatter.FormatErrorMessage("IsoCode"), "param");
            }

            var country = await CountryRepository.RetrieveCountry(param).ConfigureAwait(false);

            var countryViewModel = ViewModelMapper.MapTo <CountryViewModel>(country, param.CultureInfo);

            return(countryViewModel);
        }
Пример #2
0
        /// <summary>
        /// Retrieve the CountryViewModel
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public virtual async Task <CountryViewModel> RetrieveCountryAsync(RetrieveCountryParam param)
        {
            if (string.IsNullOrWhiteSpace(param.IsoCode))
            {
                throw new ArgumentException(GetMessageOfNullWhiteSpace(nameof(param.IsoCode)), nameof(param));
            }

            var country = await CountryRepository.RetrieveCountry(param).ConfigureAwait(false);

            var countryViewModel = ViewModelMapper.MapTo <CountryViewModel>(country, param.CultureInfo);

            return(countryViewModel);
        }