コード例 #1
0
 public List<CountryViewModel> GetCountryDetails()
 {
     DataTable country = masterDataRepository.GetCountries();
     List<CountryViewModel> lstCountry = new List<CountryViewModel>();
     if (country.Rows.Count > 0)
     {
         lstCountry = ConvertDatatableToModelList.ConvertDataTable<CountryViewModel>(country);
     }
     return lstCountry;
 }
コード例 #2
0
        public IEnumerable <CountryViewModel> GetCountries()
        {
            IList <CountryViewModel> countries = null;
            var dTable = masterDataRepository.GetCountries();

            if (null != dTable && dTable.Rows.Count > 0)
            {
                countries = new List <CountryViewModel>();
                foreach (DataRow row in dTable.Rows)
                {
                    countries.Add(new CountryViewModel
                    {
                        CountryCode = Convert.ToString(row["CountryCode"]),
                        Country     = Convert.ToString(row["Country"])
                    });
                }
            }
            return(countries);
        }