public void AddHistory(History history) { using (var db = new MysqlDataContext()) { history.HistoryId = db.History.Max(h => h.HistoryId) + 1; db.Add(history); db.SaveChanges(); } }
public void AddOwnComment(OwnComments owncomment) { using (var db = new MysqlDataContext()) { owncomment.CommentId = db.OwnComment.Max(o => o.CommentId) + 1; db.Add(owncomment); db.SaveChanges(); } }