Engineering C# Code Review

Review C# Code with AI

Correctness review with C#'s own traps: async deadlocks, undisposed IDisposables, double-enumerated LINQ, silenced nullability.

Overview

C# correctness has language-shaped corners: a .Result on a task deadlocks under a synchronization context, an undisposed connection leaks until the pool starves, a LINQ query enumerates twice and doubles its cost, a ! suppresses the nullability warning that was right. This setup runs the twelve-check correctness review with the C# language pack covering exactly those four, under Strict style — every finding flagged, APPROVED or CHANGES REQUIRED — tuned for the hotfix that has to be right the first time.

How to use this resource

  1. Run on the changed class, full file

    Async and disposal problems live in the relationships between methods — snippet scope hides them.

  2. Trust the async findings

    Sync-over-async findings are CRITICAL in request paths even when the code "works" in development.

  3. Audit the ! suppressions

    Every nullability suppression the review flags was a place someone overruled the compiler — verify they were right.

Why This Works

  • C#'s worst bugs are language-mechanical — named checks find them where generic review can't
  • Strict style suits hotfixes: the cost of a missed finding exceeds the cost of reading nits
  • Correctness focus plus language pack reviews both the logic and the runtime behavior

Best for

  • .NET services where async correctness is production correctness
  • Hotfixes reviewed under time pressure
  • Teams migrating to nullable reference types honestly

Not for

  • Architecture-level review of the service design — switch focus to Architecture
  • A persistent C# reviewer persona — that's a System Prompt (SPG) job

Use cases

  • Reviewing service classes before a hotfix ships
  • Catching .Result deadlocks before they reach a request thread
  • Flagging undisposed resources before the pool starves

FAQ

What C#-specific bugs does this review prompt look for beyond generic code review?

Four language-mechanical traps, added as checklist items 13 to 16: .Result or .Wait() async-deadlock risk, undisposed IDisposable instances missing using statements, LINQ enumerated multiple times, and nullable annotations silenced with !. Code Review Prompt Generator writes these on top of the twelve generic checks; the prompt then runs in your own assistant, which surfaces candidate findings, not a guarantee it caught them all.

Will this C# review rewrite my code or just flag issues?

It reports findings only; the prompt states "Review only — report findings; do not rewrite the code." Each finding lands as one bullet with a severity tag and the exact line, function, or symbol cited, grouped CRITICAL first, ending in an APPROVED or CHANGES REQUIRED verdict. Applying the fixes and validating the merge stays with you.

Why is this tuned to flag every finding instead of only the important ones?

Its RULES say "Flag every finding, regardless of size" and "No praise padding." That fits the REVIEW OBJECTIVE, a hotfix that has to be right the first time, where reading a NIT costs less than missing a CRITICAL. The SEVERITY RULES add that severity reflects impact, not effort to fix, so you triage from the tagged list yourself.

More resources from Code Review Prompt Generator

Resources that pair well

Related tools

Tip: Save time by exploring related resources and tools that integrate with this resource.