Beispiel #1
0
        public IList <SelectListItem> Build(EngineType engineType)
        {
            var works = workRepository.GetByEngine(engineType);

            var result = new List <SelectListItem>
            {
                new SelectListItem()
                {
                    Text = "Выберите тип обслуживания", Disabled = true, Selected = true
                }
            };

            result.AddRange(works
                            .Select(work => new SelectListItem()
            {
                Text = work.Description, Value = work.Id.ToString()
            })
                            .ToList());

            return(result);
        }