2014-10-30 57 views
0

我从Visual Studio中的NuGet管理器导入了EntityFramework.Extended包,当我将它放入我的using指令时,以下错误。c#引用错误 - 名称空间'EntityFramework'中不存在类型或名称空间名称'Extended'

The type or namespace name 'Extended' does not exist in the namespace 'EntityFramework' (are you missing an assembly reference?) 

enter image description here enter image description here enter image description here enter image description here

所以你可以看到,它是在Visual Studio中引用的,没有与using语句错误,并在我的项目的物理目录,为什么我我有这个问题...

编辑 我摆脱了扩展,我只是在做:

using EntityFramework; 

工作正常,但是当我在我的实体类上调用Delete方法时,它不能识别该方法?它说RosterSummaryData_Subject_Local_Bands类没有方法Delete。任何帮助?

enter image description here

+0

有时删除参考,并添加它放回帮助。然后重建。 – MikeG 2014-10-30 20:26:11

+1

在您的参考资料中(从图片中),双击EntityFramework.Extended并查看。确保命名空间实际上就是你认为的那样。另外,刚注意到你还有其他错误。你一定需要更正这些,但不知道它们是什么。 – 2014-10-30 20:26:29

+0

@MikeC。我在编辑中添加了其他错误。 – frontin 2014-10-30 20:53:08

回答

3

我相信引申为的EntityFramework的名字空间只是EntityFramework。从这里的源代码示例:https://github.com/loresoft/EntityFramework.Extended/blob/master/Source/EntityFramework.Extended/Container.cs

namespace EntityFramework 
{ 
/// <summary> 
/// The default <see cref="IContainer"/> for resolving dependencies. 
/// </summary> 
public class Container : IContainer 
{ 

你可能会寻找EntityFramework.Extensions命名空间。从源代码:

这个类有几个Delete方法:https://github.com/loresoft/EntityFramework.Extended/blob/master/Source/EntityFramework.Extended/Extensions/BatchExtensions.cs

+0

这有效,但它不能识别删除方法,当我使用它降低。它张贴在我的编辑 – frontin 2014-10-30 20:53:44

+0

检查我的编辑。你可能需要'EntityFramework.Extensions'命名空间。 – DLeh 2014-10-30 20:56:14

+0

做到了。感谢:D – frontin 2014-10-30 23:56:38

相关问题