I've modified an object locally and then pass it to the DAL to be updated on the connected database.
Usually I would use a stored procedure and execute reader to update the DB but this project implements a db context instead.
But when I run the method to save the changes it returns without error and the record isn't updated on the database.
Doing a search on here I came across this question suggesting to mark the db record as modified state before calling save. Which didn't correct the issue.
Question:
How can you push modified record to DB using dbcontext SaveChanges?
This is the gist of the DAL method:
public void update_Release_Status(Status recordModified)
{
//Get the original record and update with the modified values.
Status recordOriginal = db3.Status .First(i => i.ID == recordModified.ID);
db3.Entry(recordOriginal).State = System.Data.Entity.EntityState.Modified; //marked as modified here before saving
recordOriginal = recordModified;
db3.SaveChanges();
}