public ActionResult ReadXMLDevices(int groupID)
{
var query = from k in XMLEntities.unassigneditems
where k.DevOrAcc == true && k.Group == groupID
select k;
var view_query = from i in query
select new GetFreeDevices
{
MArticleNumber = i.ArticleNumber,
MFirmware = i.Firmware,
MGroup = i.Group,
MName = i.Name,
MSoftware = i.SoftwareVersion,
SA = GetNumberOfDevices(i.ArticleNumber,2),
STH = GetNumberOfDevices(i.ArticleNumber,3),
SASTH = GetNumberOfDevices(i.ArticleNumber,7)
};
return PartialView(view_query);
}
public int GetNumberOfDevices(string artNo,int loc)
{
var num_dev = (from k in XMLEntities.deviceview
where k.Reserved == false && k.Sold == false && k.LocationNameId == loc && k.ArticleNumber == artNo
select k).Count();
return num_dev;
}
错误:
准则对各实体并不承认Int32 GetNumberOfDevices(系统)的方法。 浏览法,Int32)方法,这一方法不能转化为储存的表述。 如何解决这一问题?