2014-10-30 52 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

相關問題