public int Create(DbBook book) { var newId = _books.Any() ? (_books.Max(x => x.Id) + 1) : 1; book.Id = newId; _books.Add(book); return(newId); }
public void Update(DbBook book) { var dbbook = Get(book.Id); dbbook.ISBN = book.ISBN; dbbook.Pages = book.Pages; dbbook.Title = book.Title; dbbook.Publisher = book.Publisher; dbbook.PublishDate = book.PublishDate; }