简体   繁体   English

使用模型优先生成代码时出现实体框架错误

[英]Entity Framework error when using Model First to generate code

As can be seen in the above image, I've defined an Entity Customer with a primary key Id , a FirstName and a LastName . 如上图所示,我已经定义了一个带有主键IdFirstNameLastName的Entity Customer I saved the model file and tried to build the solution. 我保存了模型文件并尝试构建解决方案。 I got the following build errors: 我遇到以下构建错误:

在此处输入图片说明

Im using Entity Framework 5 on Visual Studio 2012. My purpose is to design the model and then have the database code generated. 我在Visual Studio 2012上使用Entity Framework5。我的目的是设计模型,然后生成数据库代码。 Any idea what might be wrong? 知道有什么问题吗?

Here is some more info: 这是更多信息:

在此处输入图片说明

EDIT. 编辑。 Even more info: 更多信息:

在此处输入图片说明

转到模型浏览器,然后在其中删除重复的属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在构建Linq-to-Sql代码时强制实体框架不生成NCLOB(模型优先) - Forcing Entity Framework to not generate NCLOB's when building Linq-to-Sql Code (Model First) 使用 Code First 方法保存时,以预定义模式为字段生成唯一字符串:实体框架 - Generate an unique string for a field in a pre-defined pattern when save using Code First Approch: Entity Framework 使用Entity Framework Code First和DBMigration时生成ntext / nvarchar列 - Generate ntext/nvarchar column when using Entity Framework Code First and a DBMigration 实体框架的种子方法错误,未在代码优先模型中创建表 - Error in Seed Method of Entity Framework, Tables not created in Code First Model 使用Entity Framework,Code First(POCO)和Code Contracts运行Update-Database时出错 - Error When running Update-Database using Entity Framework, Code First (POCO) and Code Contracts DataValidation Model / ViewModel / Entity Framework Code First - DataValidation Model / ViewModel / Entity Framework Code First 映射模型实体框架4代码优先 - Mapping Model Entity Framework 4 Code First 模型用户->首先使用实体​​框架代码的FriendRequests - Model User -> FriendRequests with Entity Framework code first 实体框架代码优先模型构建器 - entity framework code first model builder 实体框架(代码优先)-动态构建模型 - Entity Framework (Code First) - Dynamically Building a Model
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM