public void AddBook(string isbn, string code, string title, string author, string subject) { Book newBook; using (var cli = new BookServiceClient()) { cli.Open(); newBook = cli.CreateBook(isbn, code, title, author, subject); cli.Close(); } if (newBook != null) { books.TryAdd(newBook.Id, newBook); } }