UPDATE tblNames
SET tblNames.firstName = John
WHERE tblNames.ID = 1
答案 0 :(得分:1)
您可以按照以下方式实现:
using (var context = new DBEntities())
{
var entity = context.tblNames.FirstOrDefault(x => x.ID == 1);
entity.firstName = "John";
context.SaveChanges();
}