There is the following linq request
var findInfoKey = dsCr.Items.Where(keyItem => keyItem.CR_ReportID == idProject); I want to understand how many records returned. Tried to learn through the Count() method, but an exception is thrown.
LINQ to Entities doesn’t recognize the System.Xml.Linq.XElement Element (System.Xml.Linq.XName) method, this method cannot be recognized.
I do not understand what the problem is. Please help me figure it out.
Entity Framework version: 6
*** I apologize, I actually did not write the full request, considering that it was not important, in fact the request looked like this:
var findInfoKey = dsCr.Items.Where(keyItem => keyItem.CR_ReportID == idProject && keyItem.iv_ID == _item.Element("iv_ID").Value); The whole problem was in _item.Element ("iv_ID"). Value, I understood that these requests are not compatible, i.e. LinqToEntity is used in LinqToObjects request, as if I understood correctly. I would be grateful if someone explains this error.
var findInfoKey = dsCr.Items.Where(keyItem => keyItem.CR_ReportID == idProject).ToList();and thenfindInfoKey.Count()- Sublihim_item.Element("iv_ID").Valuebefore the linq query itself. Then insert a variable with this value into the request. - Monk