我用這一步在我的MVC項目產生CodeFirst類:結合EF電動工具和的.edmx產生CodeFirst類和DB
1)會員支持運行我的應用程序,並調用使用會員創建MVC行動會員默認表(會員,用戶,UserInRoles,...)
2)添加新的.edmx文件到我的項目,並選擇在嚮導 「從數據庫生成」
3)編輯DB中的.edmx Visual Studio中的文件(添加新表格)
4)創建新的數據庫中的.edmx
5)使用實體框架電動工具測試版3 「反向工程代碼優先」
6)刪除現有數據庫「生成模型數據庫」並調用使用我的上下文的MVC操作
對於這種情況,是否有更簡單的方法?
我得到這個錯誤:
表「UsersInRoles」引進國外KEY約束「FK_dbo.UsersInRoles_dbo.Users_Users_UserId」可能會導致循環或多個級聯路徑。指定ON DELETE NO ACTION或ON UPDATE NO ACTION,或修改其他FOREIGN KEY約束。 無法創建約束。查看以前的錯誤。
請指導我關於錯誤和任何簡單快速的方法。
謝謝。
沒有人有任何想法嗎? – b24 2013-04-25 14:34:55