1
使用EF 4.0。我有兩個實體模型,都命名爲CoreEntities,但在不同的程序集和不同的命名空間中。實體框架元數據問題
如果我有一個單一的項目,它引用兩個assmeblies,EF似乎感到困惑,以什麼適當的元數據項目加載的。
具體來說,我得到這樣的錯誤:
The EntitySet name 'CoreEntities.MyEntities' could not be found.
只要一個刪除的組件之一的引用,錯誤停止發生。
我不確定這是否有差別,但我使用下面的代碼genereate我entitiy連接字符串:
public static string BuildEntityConnectiongString(string entityContextName)
{
//Format: metadata=res://*/{EntityContext}.csdl|res://*/{EntityContext}.ssdl|res://*/{EntityContext}.msl;provider=...
string rawString = System.Configuration.ConfigurationManager.ConnectionStrings["GenericEntityConnectionString"].ConnectionString;
return rawString.Replace("{EntityContext}", entityContextName);
}
如何EF決定去尋找嵌入式元數據,裝配在?人們會認爲它總是會在包含模型的組件中看起來,但顯然這不是它的工作方式。
想法?
是否可以顯示解決方案。我有同樣的問題,並認爲這可能是一個簡單的解決方案。 – Nugs