public void InsertBooks(Entities.book bkObj) { //NewsoftEntities dbCtx = new NewsoftEntities(); Entities.LibEntities dbCtx = new Entities.LibEntities(); dbCtx.books.Add(bkObj); dbCtx.SaveChanges(); }
public void DeleteBooks(string bookID) { Entities.LibEntities dbCtx = new Entities.LibEntities(); Entities.book bkUpdate = dbCtx.books.First(b => b.BookID == bookID); dbCtx.books.Remove(bkUpdate); dbCtx.SaveChanges(); }
public void UpdateBooks(Entities.book bkObj, string bookID) { Entities.LibEntities dbCtx = new Entities.LibEntities(); Entities.book bkUpdate = dbCtx.books.First(b => b.BookID == bookID); BaseRepository.CopyPropertyValues(bkObj, bkUpdate); dbCtx.SaveChanges(); }