Esempio n. 1
0
        public Book AddBook(Book book)
        {
            book.Id = Environment.TickCount;
            Books.Add(book);

            return book;
        }
Esempio n. 2
0
        public Book UpdateBook(Book book)
        {
            var persistedBook = Books.Single(b => b.Id == book.Id);
            Books.Remove(persistedBook);
            Books.Add(book);

            return book;
        }
Esempio n. 3
0
 public void updateBook(Book book)
 {
     var newBook = _repository.UpdateBook(book);
     Clients.bookUpdated(newBook);
 }