.net mvc 中如何多表查询数据

qq_23172683 qq_23172683 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
   Strong.IBLL.ISysUserService _userService = new SysUserService();
public ActionResult GetAllUserInfos()
{
int pageIndex = Request["page"] == null ? 1 : int.Parse(Request["page"]);
int pageSize = Request["rows"] == null ? 10 : int.Parse(Request["rows"]);
var userInfo = new UserInfoQuery()
{
PageIndex = pageIndex,
PageSize = pageSize,
Total = 0,
IsEanble = true
};
var data = from u in _userService.LoadSearchData(userInfo)
select new
{
u.UserId,
u.UserName,
u.PassWord,
u.CreateDate,
u.CreatePerson,
u.UpdateDate,
u.UpdatePerson,
u.IsEnable,
u.SortNum,
u.Description
};

var result = new { total = userInfo.Total, rows = data };
return Json(result);
}

这样查询的是一个用户表,但是我还想和角色表关联起来请问如何去写呢?
...全文

相关推荐

评论 9
收藏 已收藏
分享
返回顶部
qq_23172683
LINQ 8,492 成员 4,736 内容