C# 我在类库中看不到LINQ到SQL的扩展方法

C# 我在类库中看不到LINQ到SQL的扩展方法,c#,linq-to-sql,class-library,C#,Linq To Sql,Class Library,我创建了一个名为Repository的类库,其中包括存储SQL Server数据库ORM的LINQ To SQL文件,除此之外,我还创建了另一个名为Services的类库,它引用了存储库类库,我想使用位于Services中存储库中的LINQ to SQL文件,但我看不到扩展方法,但我可以在Services中创建LinqToSQL的实例 using System; using System.Collections.Generic; using System.Linq; using System.T

我创建了一个名为Repository的类库,其中包括存储SQL Server数据库ORM的LINQ To SQL文件,除此之外,我还创建了另一个名为Services的类库,它引用了存储库类库,我想使用位于Services中存储库中的LINQ to SQL文件,但我看不到扩展方法,但我可以在Services中创建LinqToSQL的实例

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Repository; // This is the referred class library



namespace Core {
    class BugListService {

        BBDatabaseDataContext dbContext = new BBDatabaseDataContext();

        public int CreateBug(BugList bug) {

            dbContext.BugLists. // <= The extension methods don't appear in intellisense
        }

    }
}

您能像调用普通静态方法一样调用扩展方法吗?看看你是否可以打电话:

<Declaring Type for the Extension Method>.<Extension Method Name>(bug, <other params>)
可能会给你更多的关于什么是错误的信息


另外,您可能需要检查是否有一个Using子句用于声明扩展方法的类型的确切名称空间,我过去也遇到过类似的问题…

您是否添加了对System.Core的引用?linq的扩展方法就在那里。

我应该添加System.Data.linq名称空间来继续:我已经找到了解决方案,我应该参考System.Data.LinqAlright,引用太烦人了,呃-是的:我认为VisualStudio有时候应该更聪明一些。