BookServiceClientApp.Program.RemoveChapterAsync C# (CSharp) Метод

RemoveChapterAsync() приватный статический Метод

private static RemoveChapterAsync ( ) : Task
Результат Task
        private static async Task RemoveChapterAsync()
        {
            WriteLine(nameof(RemoveChapterAsync));
            var client = new BookChapterClient(Addresses.BaseAddress);
            var chapters = await client.GetAllAsync(Addresses.BooksApi);
            var chapter = chapters.SingleOrDefault(c => c.Title == "ASP.NET Web Forms");
            if (chapter != null)
            {
                await client.DeleteAsync(Addresses.BooksApi + chapter.Id);
                WriteLine($"removed chapter {chapter.Title}");
            }

            WriteLine();
        }
    }