Complete the code to await the task without capturing the current synchronization context.
await someTask.[1](false);The ConfigureAwait(false) method tells the awaiter not to capture the current synchronization context.
Complete the code to resume on the original synchronization context after awaiting.
await someTask.[1](true);Using ConfigureAwait(true) ensures the continuation runs on the original context, which is the default behavior.
Complete the code to await the task without capturing the current synchronization context.
var result = await someTask.[1];ConfigureAwait(false) avoids capturing the synchronization context. This full expression is needed here.
Fill both blanks to create a task that does not capture the synchronization context and returns a string result.
async Task<string> GetDataAsync() {
var data = await FetchDataAsync().[1]([2]);
return data;
}Using ConfigureAwait(false) avoids capturing the synchronization context, which can improve performance in some scenarios.
Fill both blanks to create a dictionary comprehension that stores task results without capturing the synchronization context.
var results = new Dictionary<int, string>(); foreach (var id in ids) { results[id] = await GetDataAsync(id).[1]([2]); }
The correct syntax is await GetDataAsync(id).ConfigureAwait(false); The third blank is empty because the semicolon is already in the code.