Performing an update operation is an extremely simple operation. You need a reference to an existing object in the database. Once you have it, just update its properties and invoke the well-known SaveChanges method.
| C# |
Copy Code |
|
Customer customerToUpdate = dbContext.Customers.First(); customerToUpdate.Fax = "[newFax]"; dbContext.SaveChanges(); |
| VB.NET |
Copy Code |
|
Dim customerToUpdate As Customer = dbContext.Customers.First() customerToUpdate.Fax = "[newFax]" dbContext.SaveChanges() |