Configure await (ARCH105)
هذا المحتوى غير متوفر بلغتك بعد.
Key dotnet.async.configure-await · Severity info · Category async
Use ConfigureAwait(false) on await calls in library code. This avoids unnecessary synchronization context capture and reduces deadlock risk.
Incorrect
Section titled “Incorrect”public async Task<Order> GetOrderAsync(int id){ return await _repository.FindAsync(id);}Correct
Section titled “Correct”public async Task<Order> GetOrderAsync(int id){ return await _repository.FindAsync(id).ConfigureAwait(false);}Append ConfigureAwait(false) to await expressions inside library code. If needed, suppress the rule per project/workspace via except/ignore.