用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);
返回结果的时候报错了。