Hi,
I have a .NET 4 WinForms app that uses the ADO.NET Entity Framework. Some code that was working perfectly has decided to stop working and although I've tried to figure out what changed that could cause this, I am stumped. This code looks perfectly functional to me and WAS working as intended.
Anyone have any ideas? Here is the code:
using (var pe = new ProposalEstimateEntities())
{
var tmc = GetToolingAndMaterialsCost(taskId, Constants.Materials);
if (tmc == null) return;
tmc.Amount = amount;
pe.SaveChanges();
}
The tmc variable holds a ToolingAndMaterialsCost entity object after the method call, so there is no need to add the object to the context. SaveChanges() should save the object with the new amount, but doesn't. No exception is thrown. The code executes like it is dumb and happy, but nothing changes in the database and when I return to the control that displays the data, the old pre-edit data is there.
This is very frustrating, any help would be greatly appreciated.
Mike