public void UpdateStatus(int BookID, int userID, int Status) { BookTransitionTable bookList = db.BookTransitionTables.Where(x => x.UserID == userID).Where(x => x.BookID == BookID).Single(); bookList.StatusID = Status; db.SaveChanges(); }
public void UpdatestatusToHaveNotRead(int BookID, int userID) { BookTransitionTable bookList = db.BookTransitionTables.Where(x => x.UserID == userID).Where(x => x.BookID == BookID).Single(); bookList.StatusID = 1; db.SaveChanges(); }
public void addNew(int BookID, int userID) { BookTransitionTable newElement = new BookTransitionTable(); newElement.BookID = BookID; newElement.StatusID = 1; newElement.UserID = userID; newElement.Read = true; db.BookTransitionTables.Add(newElement); db.SaveChanges(); }