我尝试在 SQL db 中进行更新并得到错误
使用来自http://msdn.microsoft.com/en-us/library/bb399339.aspx的官方文档
var query =
from ord in db.Orders
where ord.OrderID == 11000
select ord;
foreach (Order ord in query)
{
ord.ShipName = "Mariner";
ord.ShipVia = 2;
}
db.SubmitChanges();
using(var ctx = new FooContext()) {
var obj = ctx.Bars.Single(x=>x.Id == 1100);
obj.SomeProp = 123;
ctx.SubmitChanges();
}}
为什么是错误?
ord.ShipName
Cannot resolve symbol 'ShipName'
var obj = ctx.Bars.Single(x=>x.Id == id);
Cannot resolve symbol 'Id'