在向表中插入数据时出现错误,“无法更新实体集”。
在向表中插入数据时出现错误,“无法更新实体集”。
我正在尝试将数据保存到数据库中。表名为product_color
。
public void PostAddColour1() { product_color pc = new product_color(); pc.id = 999; pc.product_id=2; pc.color_id=1; pc.display_order=3; db.product_color.Add(pc); db.SaveChanges(); }
这是将数据插入表中的函数代码。
当调用db.SaveChanges();
时,下面的错误会显示:
Unable to update the EntitySet 'product_color' because it has a DefiningQuery and no element exists in the ModificationFunctionMapping> element to support the current operation.
admin 更改状态以发布 2023年5月21日