public IActionResult Index() { var countries = _countriesService.GetAll() .OrderBy(country => country.Name) .Select(c => new CountriesListingModel { Id = c.Id, Name = c.Name, FlagUrl = c.FlagUrl }); var model = new CountriesIndexModel { CountriesList = countries }; return(View(model)); }