【发布时间】:2014-01-15 01:34:58
【问题描述】:
使用 Entity Framework 时,我在 asp.net 中收到此错误:
“无法将类型 System.Data.EntityState 隐式转换为 System.Data.Entity.EntityState。存在显式转换(您是否缺少强制转换?)”
这里是sn-p:
foreach (OrderLine line in order.OrderLines)
{
context.Entry(line.Product).State = System.Data.EntityState.Modified;
}
请建议我应该如何解决该错误。
【问题讨论】:
-
context是什么类型?
标签: c# asp.net entity-framework