I have this code. The code will find the correct log but won't save any changes back to the database. How would I get it to save?
var query = from log in db.Logs
where log.LogID == id
select log;
foreach (Log log in query)
{
log.DateTimeResolved = System.DateTime.Now;
db.Entry(query).State = EntityState.Modified;
}
try
{
db.SaveChanges();
}
catch (Exception e)
{ }
return RedirectToAction("Index");
catchblock - any error you get is being ignored.db.Entry(log)but Still, you should not need that.ewhen you debug this?