示例#1
0
        private List <SelectListItem> PopulatePositions()
        {
            IEnumerable <Position> positions = _databaseWorker.GetAllPositions();
            List <SelectListItem>  items     = new List <SelectListItem>();

            foreach (Position position in positions)
            {
                items.Add(new SelectListItem {
                    Text = position.Name, Value = position.Id.ToString()
                });
            }

            return(items);
        }