【发布时间】:2014-04-06 23:56:29
【问题描述】:
我有这个简单的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Linq;
using GadNameSpace;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
GadEntities db = new GadEntities();
var images = db.Images.Where(x => x.isApproved == true).ToList();
Repeater1.DataSource = images;
Repeater1.DataBind();
}
}
现在如果我要编辑这一行:
var images = db.Images. <--this is where intellisense is not working...
它以前工作过。相同的文件,相同的项目,相同的解决方案。 如果我手动编写代码并运行它,它工作正常。 我试过开始 > cmd > “devenv /ResetSettings” 我也尝试重新启动电脑。 问题仅在于 Linq 智能感知!对于其他任何智能感知工作都很好......
有什么好主意吗?
【问题讨论】:
-
尝试添加“使用 System.Core;”
-
@KoViMa 你确定吗?
-
您说“仅在 Linq 中发生”但是我敢打赌,如果您这样做:
var ints = new[] {1, 2, 3}; var twoOnly = ints.Where(i => i == 2);那么我确定智能感知会正确显示吗?请尝试(在同一个源文件中);然后报告...
标签: c# linq linq-to-entities intellisense