-2
我正在一個錯誤在這行代碼Session.Linq<Employees>()
:對象引用不設置爲一個對象的一個實例在會話
「的對象引用需要非靜態字段,方法或屬性」 System.Web.UI.Page.Session.get」
這是我的代碼:
public static object GetData(Dictionary<string, object> tableParams)
{
IQueryable<Employees> Employee = Session.Linq<Employees>();
if (tableParams.ContainsKey("sEcho"))
{
var parser = new DataTableParser<Employees>(tableParams, Employee);
return parser.Parse();
}
return Employee;
}
如果我使用HttpContext.Current.Session.Linq<Employees>();
然後灌胃等:
「System.Web.SessionState.HttpSessionState」不包含關於「的LINQ」的定義和沒有擴展方法「的LINQ」接受類型「System.Web.SessionState.HttpSessionState」的第一個參數可以是發現'
我需要做些什麼才能使這個工作?我是否缺少Linq關於Session的命名空間?我正在使用System.Linq
和System.Linq.Expression
。
什麼是'Linq的()'? –
jrummell
@ jrummell有點像'Cup' –
mattytommo