public void Create(HistoryTable historyTable) { DateTime tm = DateTime.Now; HistoryTable history = new HistoryTable(); history.Status = historyTable.Status; history.Story_id = historyTable.ID; history.Time_enter = tm; history.Comment = historyTable.Comment; db.HistoryTables.Add(history); db.SaveChanges(); var item = db.StoryTables.Where(x => x.ID == historyTable.ID).First(); item.Status = historyTable.Status; db.SaveChanges(); }
public void Update(HistoryTable historyTable) { db.Entry(historyTable).State = EntityState.Modified; }