admin管理员组

文章数量:1627760

异常描述:   捕捉到 System.Data.Entity.Infrastructure.DbUpdateException
  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