async_enumerable.cs

C#•마스터

탐색기

C40
C++40
C#
초급10
중급10
고급10
전문가5
마스터5
async_enumerable.cs
channel_pipeline.cs
source_generator.cs
span_memory.cs
pattern_switch.cs
Dart40
Go40
Java40
JavaScript40
Kotlin40
Objective-C40
Perl40
PHP40
Python40
R40
Ruby40
Rust40
Shell40
Swift40
TypeScript40
async_enumerable.cs
Click to focus
1
2
3
4
5
6
7
8
9
10
async IAsyncEnumerable<T> FetchPages<T>(string url, CancellationToken ct = default) {↵
   int page = 0;↵
   while (!ct.IsCancellationRequested) {↵
       var data = await http.GetFromJsonAsync<PagedResult<T>>($"{url}?page={page++}", ct);↵
       if (!data.Items.Any()) yield break;↵
       foreach (var item in data.Items) {↵
           yield return item;↵
       }↵
   }↵
}
0WPM•0%•0:00•0/365(0%)|Ln 1, Col 1
UTF-8•C#

관련 연습 문제