Пример #1
0
        public List <Dropdownlist> GetRoledrp(int id)
        {
            var query = _dbFirms.GetAllRoles().ToList();
            List <Dropdownlist> list = new List <Dropdownlist>();

            foreach (var item in query)
            {
                list.Add(new Dropdownlist()
                {
                    Value    = item.RoleID,
                    Label    = item.RoleName,
                    Selected = item.RoleID == id ? true : false
                });
            }
            return(list);
        }