public Book.info.Books Update(Book.info.Books update) { var query = Book.SingleOrDefault(r => r.Id == update.Id); if (update != null) { query.Id = update.Id; query.Name = update.Name; query.Price = update.Price; query.Author = update.Author; } return(query); }
public Book.info.Books Add(Book.info.Books added) { Book.Add(added); added.Id = Book.Max(r => r.Id) + 1; return(added); }