异常描述: 捕捉到 System.Data.Entity.Infrastructure.DbUpdateExceptionadmin管理员组文章数量:1627760
HResult=-2146233087
Message=无法更新 EntitySet“CashRequest”,因为它有一个 DefiningQuery,而 <ModificationFunctionMapping> 元素中没有支持当前操作的 <InsertFunction> 元素。
Source=EntityFramework
StackTrace:
在 System.Data.Entity.Internal.InternalContext.SaveChanges()
在 System.Data.Entity.Internal.LazyInternalContext.SaveChanges()
在 System.Data.Entity.DbContext.SaveChanges()
在 Core.ServiceBase`1.Add(T entity) 位置 d:\WORK\LssNew\Core\ServiceBase.cs:行号 171
在 Lss.App.Controllers.MechanicController.CashAction(Int32 WorkerID, Double CashNum) 位置 d:\WORK\LssNew\Lss.App\Controllers\MechanicController.cs:行号 1201
InnerException: System.Data.Entity.Core.UpdateException
HResult=-2146232032
Message=无法更新 EntitySet“CashRequest”,因为它有一个 DefiningQuery,而 <ModificationFunctionMapping> 元素中没有支持当前操作的 <InsertFunction> 元素。
Source=EntityFramework.SqlServer。 异常原因及处理: 数据库中该实体表无主键,设置主键后更新模型就解决
转载于:https://wwwblogs/ZaraNet/p/9685699.html
本文标签: DataSystementityDbUpdateExceptionInfrastructure
版权声明:本文标题:System.Data.Entity.Infrastructure.DbUpdateException 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1729000512a1182539.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论