我的自定义ado.net提供商合作,并使用该供应商我一体的实体框架支持Visual Studio 2010中,我创造一切可能的映射,并创建模型从数据库读取表格对象的所有相关元数据。对于我的测试,表格包含主键和其他字段。当我使用这个表创建一个数据库模型,我得到了所有列映射和一切的典范,但我还可以得到下面的错误信息:实体框架4.0生成只读模型,当我从现有的数据库
The model was generated with warnings or errors. Please see the Error List for more details. These issues must be fixed before running your application. Loading metadata from the database took 00:00:11.4799371. Generating the model took 00:00:04.2751189. Added the connection string to the App.Config file. Writing the .edmx file took 00:00:00.0005060.
如果我打开.edmx文件与XML编辑器,我见出现以下错误:
<!--Errors Found During Generation:
warning 6002: The table/view 'sqlfire.APP.CUSTOMERS' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
-->
它还为表添加了SELECT ...语句的DefiningQuery。
我准备了一圈找到解决的办法,并拼命地寻找在这个问题上有所帮助。
很好的问题,亲爱的..同样的问题IHAVE – Ajay2707