Dbcontext db=new ();var EMp=db.Employees.where(p=>p.Name="tom").FirstOrDefault();if(Emp!=null){Emp.Age=10;}先找后修改最后提交db.SaveChanges();