Skip to content

Instantly share code, notes, and snippets.

@davidsonsousa
Created April 18, 2015 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidsonsousa/7790a4220cf3b8c82541 to your computer and use it in GitHub Desktop.
Save davidsonsousa/7790a4220cf3b8c82541 to your computer and use it in GitHub Desktop.
private List<Country> _countries;
public IEnumerable<SelectListItem> CountryItems
{
get
{
IEnumerable<SelectListItem> selectCountries = new List<SelectListItem>();
selectCountries = _countries.Select(x => new SelectListItem
{
Value = x.Id.ToString(),
Text = x.Name
});
return DefaultItem.Concat(selectCountries);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment