I am updating data in the table and then on its update inserting date in other history table with has same fields as first table.
my code is:
public void SaveChanges()
{
objectdateContext.SaveChanges();
saveInHistoryTable(); // here how i can pass the current entity.
}
public void saveInHistoryTable(FirstTable f)
{
SecondTable s = new SecondTable();
s.id = f.id;
s.Name = f.Name;
objectdateContext.Insert(s);
}
Please guide me thanks.