public async Task UpdateChapterAsync()
        {
            Console.WriteLine(nameof(UpdateChapterAsync));
            var chapters = await _bookChapterClientService.GetAllAsync(_urlService.BookApi);

            var chapter = chapters.SingleOrDefault(c => c.Title == "WXG");

            if (chapter != null)
            {
                chapter.Title = "WXG! Hello World!";
                await _bookChapterClientService.PutAsync(_urlService.BookApi + chapter.Id, chapter);

                Console.WriteLine($"updated chapter {chapter.Title}");
            }
        }
        public async Task UpdateChapterAsync()
        {
            Console.WriteLine(nameof(UpdateChapterAsync));
            var chapters = await _client.GetAllAsync(_urlService.BooksApi);

            var chapter = chapters.SingleOrDefault(c => c.Title == ".NET Application Architectures");

            if (chapter != null)
            {
                chapter.Title = ".NET Applications and Tools";
                await _client.PutAsync(_urlService.BooksApi + chapter.Id, chapter);

                Console.WriteLine($"updated chapter {chapter.Title}");
            }
            Console.WriteLine();
        }
示例#3
0
        public async Task UpdateChapterAsync()
        {
            Console.WriteLine(nameof(UpdateChapterAsync));
            var chapters = await _client.GetAllAsync(_urlService.BooksApi);

            var chapter = chapters.SingleOrDefault(c => c.Title == "Windows Store Apps");

            if (chapter != null)
            {
                chapter.Number = 32;
                chapter.Title  = "Windows Apps";
                await _client.PutAsync(_urlService.BooksApi + chapter.Id, chapter);

                Console.WriteLine($"updated chapter {chapter.Title}");
            }
            Console.WriteLine();
        }