我有这段正常运作的代码。
但是当我添加where条件时
var h = db.MyTable.Include("Children").Include("Parent").ToList();
但是当我添加where条件时
var h = db.MyTable.Include("Children").Include("Parent").Where(x => x.Country==Session["country"].ToString()).ToList();
它给我抛出了一个错误。
LINQ to Entities does not recognize the method 'System.Object get_item (System.String)' method , and this method cannot be translated into a store expression.
我怎么重写它?我是初学者:-) 谢谢