MVC EntityType has no key defined

简介: 关于MVC EntityType has no key defined的问题,如下:   可以采用在该字段上面再添加一个[Key]来解决。

关于MVC EntityType has no key defined的问题,如下:

 

image

可以采用在该字段上面再添加一个[Key]来解决。要先引用:

using System.ComponentModel.DataAnnotations;

[Key]
public int ProId { get; set; }

 

image

 

 

参考文献:

http://www.cnblogs.com/haisa/archive/2011/08/09/2131746.html

相关文章
【小家Spring】面向切面编程之---Spring AOP的原理讲解以及源码分析(Cannot find current proxy: Set 'exposeProxy' property on )(下)
【小家Spring】面向切面编程之---Spring AOP的原理讲解以及源码分析(Cannot find current proxy: Set 'exposeProxy' property on )(下)
【小家Spring】面向切面编程之---Spring AOP的原理讲解以及源码分析(Cannot find current proxy: Set 'exposeProxy' property on )(下)
Spring MVC 出现Request method ‘GET‘ not supported解决办法
Spring MVC 出现Request method ‘GET‘ not supported解决办法
|
7月前
spring-state-machine拦截器
spring-state-machine拦截器
52 0
SpringMVC中context:annotation-config与mvc:annotation-driven和context:component-scan区别详解
SpringMVC中context:annotation-config与mvc:annotation-driven和context:component-scan区别详解
65 0
Spring Cache抽象-使用SpEL表达式
Spring Cache抽象-使用SpEL表达式
275 0
【elementUI + Spring报错解决方案】Required request part ‘*****‘ is not present
【elementUI + Spring报错解决方案】Required request part ‘*****‘ is not present
1048 0
【elementUI + Spring报错解决方案】Required request part ‘*****‘ is not present
Configuration problem: Failed to import bean definitions from URL location classpath:spring-mvc.xml
Configuration problem: Failed to import bean definitions from URL location classpath:spring-mvc.xml
862 0
猿创征文|Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time.
猿创征文|Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time.
1108 0
猿创征文|Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time.
Auto Mapper04(MVC中的配置)
Auto Mapper04(MVC中的配置)
111 0
Auto Mapper04(MVC中的配置)
玩转Spring Cache --- @Cacheable使用在MyBatis的Mapper接口上(解决Null key returned for cache operation)【享学Spring】(下)
玩转Spring Cache --- @Cacheable使用在MyBatis的Mapper接口上(解决Null key returned for cache operation)【享学Spring】(下)
玩转Spring Cache --- @Cacheable使用在MyBatis的Mapper接口上(解决Null key returned for cache operation)【享学Spring】(下)