【问题标题】:Type or Namespace IQueryable Could Not Be Found找不到类型或命名空间 IQueryable
【发布时间】:2016-03-05 13:54:46
【问题描述】:

最近我使用实体框架将 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);
}

【问题讨论】:

  • 什么是错误!?!?我们无法读取您的屏幕 - 也无法读取您的想法 - 您必须向我们展示!

标签: entity-framework edmx-designer


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2016-01-31
    • 1970-01-01
    • 1970-01-01
    • 2013-03-25
    • 2017-07-12
    • 2011-05-13
    • 2021-03-01
    • 2020-08-13
    相关资源
    最近更新 更多