原文:EF An error occurred while updating the entries. See the inner exception for details.

EF新增数据时报插入失败id不能为null, 但是我们有赋值。 System.Data.SqlClient.SqlException: 不能将值 NULL 插入列 ID ,表 dbo.Sys MenuBasis 列不允许有 Null 值。INSERT 失败。 这里是因为ef把数据带有id属性都当成自增id导致的 解决的方法 public class ERPContext : DbContext p ...

2018-06-19 18:28 0 4320 推荐指数:

查看详情

 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM