【发布时间】:2013-11-16 10:57:42
【问题描述】:
我正在尝试在 IQueryable 集上使用 Include 扩展,但我遇到了以下问题:
错误 1 'System.Linq.IQueryable<.model.insurancecasetype>' 不包含“包含”的定义,也没有扩展方法 'Include' 接受类型的第一个参数 'System.Linq.IQueryable<.model.insurancecasetype>' 可以 被发现(您是否缺少 using 指令或程序集 参考?)
我的代码:
var allCaseTypes = Uow.InsuranceCaseType.GetAll().Include(a=>a.Geos);
方法 GetAll() 返回 - IQueryable<.Model.InsuranceCaseType>
我在范围内有以下命名空间:
using System.Collections;
using System.Collections.Generic;
using System;
using System.Data;
using System.Linq;
using System.Data.Entity;
using System.IO;
using System.Web;
using System.Web.Mvc;
【问题讨论】:
-
错误信息告诉你出了什么问题。您缺少 using 指令或程序集引用。 方法在什么命名空间和程序集中?