示例#1
0
        /// <summary>
        /// 获取所有按钮
        /// </summary>
        /// <returns></returns>
        public async Task <IActionResult> GetRole(Guid id)
        {
            var getResult = await _roleServices.GetListAsync(Specification <Role> .Eval(d => !d.IsDelete));

            var roles = getResult.data.Select(d => new Select
            {
                value    = d.Id.ToString(),
                Name     = d.Name,
                selected = d.UserRoles.Any(x => x.RoleId == d.Id && x.UserManagerId == id)
            }).ToList();

            return(Json(roles));
        }