在使用Entity Framework时,我遇到了以下错误:“Cannot implicitly convert type System.Data.EntityState
to System.Data.Entity.EntityState
. An explicit conversion exists (are you missing a cast?)”。
以下是代码片段:
foreach (OrderLine line in order.OrderLines)
{
context.Entry(line.Product).State = System.Data.EntityState.Modified;
}
请建议我应该做些什么来解决这个错误。
context
是什么类型? - trailmax