How do I go about changing a database row? There is no means for updating the data, and if I use add but the main key id is already there, I receive an error. If you can, give us an example.
The simplest method is:
(1) Using pk, obtain the current row.
(2) Refresh properties
(3) use context's SaveChanges() method.
var student = context.Students.Find(42); student.Description = "updated"; context.SaveChanges();
Here is a technique I used that didn't need me to first ask a question:
context.Students.Attach(student); context.Entry(student).State = EntityState.Modified; context.SaveChanges();