Example #1
0
        public IEnumerable <SelectListItem> GetColors()
        {
            var colors = _colorLogic.GetAll().
                         Select(s => new SelectListItem
            {
                Text  = s.Name,
                Value = s.Id.ToString()
            }).ToList();

            return(colors);
        }
Example #2
0
        public List <SelectListItem> GetColors()
        {
            var colors = _colorLogic.GetAll().
                         Select(s => new SelectListItem
            {
                Text  = s.Name,
                Value = s.Id.ToString()
            }).ToList();

            colors.Add(new SelectListItem {
                Value = "0", Text = "Любой", Selected = true
            });

            return(colors);
        }
Example #3
0
 public ActionResult Index()
 {
     return(View(_colorLogic.GetAll()));
 }