Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. public List<CountryGridViewModel> GetSearchCountry(CountryContentViewModel ItCountryContentViewModel)
  2. {
  3. List<CountryGridViewModel> ItListCountryGridViewModel = new List<CountryGridViewModel>();
  4.  
  5. using (var db = new learnEntities())
  6. {
  7. var listCountries = db.USP_GetCountry(ItCountryContentViewModel.country_id, ItCountryContentViewModel.country_name).ToList();
  8.  
  9. foreach(var country in listCountries)
  10. {
  11. CountryGridViewModel ItCountryGridViewModel = new CountryGridViewModel();
  12. ItCountryGridViewModel.Country_Id = country.Country_Id;
  13. ItCountryGridViewModel.Country_Name = country.Country_Name;
  14.  
  15. ItListCountryGridViewModel.Add(ItCountryGridViewModel);
  16.  
  17.  
  18.  
  19. }
  20. }
  21.  
  22. return ItListCountryGridViewModel;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement