public List <string> GetStateList(string country) { var provinces = CountryProvinces.FirstOrDefault(p => p.CountryName == country)?.Provinces; StateList = provinces?.Select(p => (string)p.ProvinceName).Distinct().ToList(); return(StateList); }
private void GetStateList() { if (!string.IsNullOrEmpty(CountryName)) { var provinces = CountryProvinces.FirstOrDefault(p => p.CountryName == CountryName)?.Provinces; StateList = provinces?.Select(p => (string)p.ProvinceName).Distinct().ToList(); } }