首页 新闻 会员 周边 捐助

返回结果报错When an object is returned......

0
悬赏园豆:10 [已关闭问题] 关闭于 2019-07-17 16:55

用ef查询,两个list集合,list集合的对象都是一样的,但是,返回结果的时候报错:
When an object is returned with a NoTracking merge option, Load can only be called when the EntityCollection or EntityReference does not contain objects.

弄不明白怎么回事?

代码如下:
List<Base_User> manageList = new List<Base_User>();
List<Base_User> leaderList = new List<Base_User>();

manageList = OperateContext.Current.BllContext.IBase_UserBll.GetList(c => c.TeamId == KeyValue && c.DeleteMark == 0 && c.InnerUser != 1 && c.CompId == userContext.User.CompId && manageUserIds.Contains(c.UserId)).ToList();

leaderList = OperateContext.Current.BllContext.IBase_UserBll.GetList(c => c.TeamId == KeyValue && c.DeleteMark == 0 && c.InnerUser != 1 && c.CompId == userContext.User.CompId && leaderUserIds.Contains(c.UserId)).ToList();

return Json(new { manageList, leaderList }, JsonRequestBehavior.AllowGet);
返回结果的时候报错了。

1sa2sa的主页 1sa2sa | 菜鸟二级 | 园豆:289
提问于:2019-07-17 16:41
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册