Example #1
0
        /// <summary>
        /// Gets the name of the country item by three letter iso region.
        /// </summary>
        /// <param name="threeLetterIsoRegionName">Name of the three letter iso region.</param>
        /// <returns>Country.</returns>
        public Country GetCountryItemByThreeLetterIsoRegionName(string threeLetterIsoRegionName)
        {
            Country country = (from c in GetCountryItems()
                               where c.ThreeLetterIsoRegionName.Equals(threeLetterIsoRegionName)
                               select c).FirstOrDefault();

            if (country == null)
            {
                country = new Country();
                country.AddError(String.Format("Country with threeLetterIsoRegionName '{0}' not found", threeLetterIsoRegionName));
            }
            return(country);
        }
Example #2
0
        /// <summary>
        /// Gets the name of the country item by.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns>Country.</returns>
        public Country GetCountryItemByName(string name)
        {
            Country country = (from c in GetCountryItems()
                               where c.DefaultName.Equals(name)
                               select c).FirstOrDefault();

            if (country == null)
            {
                country = new Country();
                country.AddError(String.Format("Country with name '{0}' not found", name));
            }
            return(country);
        }