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