Answers for "update record in entity framework using linq"

C#
1

update multiple records with entity framework

using (var dbcontext = new MyModel()){
   var matchedRecords = dbcontext.DummyTable.Where(e => e.code.Equals(entry.code) && e.isValid.Equals(true)).ToList();
   matchedRecords.ForEach(e => e.isValid = false);
   dbcontext.SaveChanges();
}
Posted by: Guest on August-29-2020
0

how to update record using entity framework 5

BY LOVE SINGH.

employeeDBEntities.tblEmployee.Attach(objTblEmployee);
employeeDBEntities.Entry(objTblEmployee).State = EntityState.Modified;
employeeDBEntities.SaveChanges();
Posted by: Guest on May-17-2020

Code answers related to "update record in entity framework using linq"

C# Answers by Framework

Browse Popular Code Answers by Language