public void DeleteBookByID(int id) { int i; List <Book> books = bookData.GetBook(); for (i = 0; i < books.Count; i++) { if (books[i].Id == id) { bookData.DeleteById(books[i]); } } }