public void handleUpdate(USER_BOOK a) { var udObj = db.USER_BOOK.SingleOrDefault(x => x.BOOKID == a.BOOKID); udObj = a; db.SaveChanges(); }
public void handleInsert(USER_BOOK a) { try { db.USER_BOOK.Add(a); db.SaveChanges(); } catch (Exception e) { Console.WriteLine("Error: \n" + e); } }