private static IEnumerable <SelectListItem> SelectTypeNames(IBuildingTypeRepository repository) { return(repository.GetAll().Select(e => new SelectListItem { Text = e.Name, Value = e.Name }).ToList()); }
private static IEnumerable <SelectListItem> SelectTypeNames(IBuildingTypeRepository repository) { List <string> typeNames = new List <string>(); typeNames.Add("---"); typeNames.AddRange(repository.GetAll().Select(e => e.Name)); return(typeNames.Select(e => new SelectListItem { Text = e, Value = e }).ToList()); }