c#引用错误 - 名称空间'EntityFramework'中不存在类型或名称空间名称'Extended'
问题描述:
我从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?)
所以你可以看到,它是在Visual Studio中引用的,没有与using语句错误,并在我的项目的物理目录,为什么我我有这个问题...
编辑 我摆脱了扩展,我只是在做:
using EntityFramework;
工作正常,但是当我在我的实体类上调用Delete方法时,它不能识别该方法?它说RosterSummaryData_Subject_Local_Bands类没有方法Delete。任何帮助?
答
我相信引申为的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
有时删除参考,并添加它放回帮助。然后重建。 – MikeG 2014-10-30 20:26:11
在您的参考资料中(从图片中),双击EntityFramework.Extended并查看。确保命名空间实际上就是你认为的那样。另外,刚注意到你还有其他错误。你一定需要更正这些,但不知道它们是什么。 – 2014-10-30 20:26:29
@MikeC。我在编辑中添加了其他错误。 – frontin 2014-10-30 20:53:08