예제 #1
0
        public Book AddBook(Book book)
        {
            book.Id = Environment.TickCount;
            Books.Add(book);

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

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