无法找到类型或命名空间IQueryable

时间:2016-03-05 13:54:46

标签: entity-framework edmx-designer

最近我使用Entity Framework将ado.net .edmx添加到我的ASP.NET MVC项目中,但context.cs中存在错误

[DbFunction("Entities", "Split_Str")]
public virtual IQueryable<Split_Str_Result> Split_Str(string list, string splitChar)
{
    var listParameter = list != null ?
            new ObjectParameter("list", list) :
            new ObjectParameter("list", typeof(string));

    var splitCharParameter = splitChar != null ?
            new ObjectParameter("splitChar", splitChar) :
            new ObjectParameter("splitChar", typeof(string));

    return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<Split_Str_Result>("[Entities].[Split_Str](@list, @splitChar)", listParameter, splitCharParameter);
}

1 个答案:

答案 0 :(得分:1)

如果还没有,请尝试添加using System.Linq;