Пример #1
0
        /// <summary>
        /// 根据用户Id获取角色详情
        /// </summary>
        /// <param name="db"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public List <UserRoleInfoModel> GetRoleByUserId(DBContainer db, string id)
        {
            var roles = db.P_Sys_GetRoleByUserId(id);
            List <UserRoleInfoModel> modelList = (from r in roles
                                                  select new UserRoleInfoModel()
            {
                Id = r.Id,
                Name = r.Name,
                Description = r.Description,
                CreateTime = r.CreateTime,
                CreatePerson = r.CreatePerson,
                Flag = r.Flag
            }).ToList();

            return(modelList);
        }
 public IQueryable <P_Sys_GetRoleByUserId_Result> GetRoleByUserId(DBContainer db, string userId)
 {
     return(db.P_Sys_GetRoleByUserId(userId).AsQueryable());
 }