private void InsertAvailableCountries(List <CountryLocaleList> availableCountries) { CountryText countryLocale; foreach (CountryLocaleList countryRowRecord in availableCountries) { // Insert for each locale country information. foreach (CountryInfo countryInfo in countryRowRecord.Countries) { countryLocale = new CountryText(); // Insert Country countryLocale.CountryId = _dbRepository.AddCountry(countryInfo); countryLocale.Locale = countryRowRecord.Locale; countryLocale.Name = countryInfo.CountryName; _dbRepository.AddOrUpdateCountryLocale(countryLocale); } } }