Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Reviews .NET changes for bugs, regressions, async and disposal mistakes, missing tests, and platform-specific pitfalls before merge.
91% 95%+5 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 20 of 22 without it.
Review this C# PR diff that changes `OrderProcessor.cs` to use synchronous IO inside an async loop. Provide your complete review evaluation.
Lists findings before giving the high-level summary.
3 of 3 safety checks passed
This reference covers common patterns and anti-patterns for async code, resource disposal, and security in .NET code reviews.
Async should propagate through the entire call chain. Blocking on async code causes deadlocks and thread pool starvation.
// GOOD: Async propagates through the call chain
public class OrderService(IOrderRepository repository, IPaymentGateway paymentGateway)
{
public async Task<OrderResult> ProcessOrderAsync(Order order, CancellationToken cancellationToken = default)
{
var validated = await ValidateOrderAsync(order, cancellationToken);
var payment = await paymentGateway.ChargeAsync(order.Total, cancellationToken);
return await repository.SaveOrderAsync(validated, payment, cancellationToken);
}
}
// BAD: Blocking on async - causes deadlocks in UI/ASP.NET contexts
public class OrderService(IOrderRepository repository, IPaymentGateway paymentGateway)
{
public OrderResult ProcessOrder(Order order)
{
// NEVER DO THIS - deadlock risk
var validated = ValidateOrderAsync(order).Result;
var payment = paymentGateway.ChargeAsync(order.Total).GetAwaiter().GetResult();
return repository.SaveOrderAsync(validated, payment).Wait();
}
}
Always accept and propagate CancellationToken to support cooperative cancellation.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.