C# Code Review: Checklist, Examples, and Best Tools (2026)

code review c#

A good C# code review needs to catch problems that pass the compiler, but can still cause failures once the application is in production.

A null that never got handled. An async method blocking threads. Entity Framework queries that run fine with a handful of rows and slow down as the database grows. Or resources that stay open because nobody took care of disposal.

These are some of the problems a code review needs to catch before the merge.

In this guide, we put together a C# code review checklist, best practices, code examples, and tools that help automate part of this process in .NET projects.

Why C# code review matters

Compiling without errors doesn’t mean the code is correct.

The compiler can catch syntax and type problems, but it doesn’t necessarily know whether an Entity Framework query will run hundreds of database calls, or whether a change respects the application’s business rules.

That’s where code review comes in.

In C# and .NET projects, review helps you:

  • Catch logic problems: find implementations that compile but don’t deliver the expected behavior.
  • Avoid performance problems: spot inefficient queries, blocking calls in async code, and unnecessary allocations.
  • Reduce security risk: review validation, permissions, handling of external input, and exposure of sensitive data.
  • Keep the codebase consistent: make sure different developers follow the same architecture, naming, and organization patterns.
  • Avoid regressions: consider how a change might affect other services, shared libraries, or existing functionality.

This matters even more in large codebases, where a seemingly small change can affect several parts of the application.

C# code review checklist

Before approving a pull request, it helps to have a list of checks that surface the main risks in the change.

The checklist below is organized by category. You don’t need to apply every item to every PR. Pick the points that are relevant to the kind of change in front of you.

1. Code quality and readability

  • Does the code follow C# naming conventions?
  • Do classes and methods have well-defined responsibilities?
  • Is there duplicated code that could be reused instead?
  • Are the access modifiers (public, private, internal) correct?
  • Does the code avoid unnecessary complexity?
  • Are the rules in .editorconfig being followed?

2. Asynchronous programming

  • Do the methods use async/await correctly?
  • Are there unnecessary calls to .Result or .Wait()?
  • Do the async methods return Task, Task<T>, or another appropriate type?
  • Do operations that need to support cancellation receive and propagate a CancellationToken?
  • Are exceptions from async operations handled correctly?

3. Performance and resource management

  • Do objects that implement IDisposable or IAsyncDisposable have a clear lifetime?
  • Are there unnecessary memory allocations on critical paths?
  • Do LINQ operations avoid multiple enumerations when they don’t need to?
  • Are there costly operations inside loops?
  • Have potential performance bottlenecks been considered?

4. Database and Entity Framework Core

For projects using EF Core:

  • Do the queries avoid N+1 problems?
  • Do read-only queries use AsNoTracking() where appropriate?
  • Is there pagination for queries that could return a large number of rows?
  • Do the queries load only the data they need?
  • Do the changes preserve data integrity?
  • Are the migrations compatible with the deployment strategy?

5. Security

  • Is external input validated?
  • Do sensitive endpoints and operations have authorization checks?
  • Do SQL queries use parameters instead of concatenating user input?
  • Has no credential or sensitive information been added to the code?
  • Do logs and error messages avoid exposing sensitive data?
  • Have new dependencies been checked for known vulnerabilities?

6. Error handling and observability

  • Are exceptions handled at the right level?
  • Are there catch blocks that silently swallow errors?
  • Do the logs carry enough context to investigate a failure?
  • Do error messages avoid exposing internal details?
  • Are failures in external services handled properly?

7. Tests and business rules

  • Does the implementation meet the requirements in the PR?
  • Are there tests for the main behaviors that changed?
  • Have edge cases and invalid input been considered?
  • Do the existing tests still pass?
  • Does the change preserve compatibility with other parts of the application?
  • Have changes to API contracts been evaluated against their consumers?

8. Before approving the pull request

  • Does the PR explain what changed and why?
  • Does the code compile without errors?
  • Did the automated CI checks pass?
  • Are there no leftover temporary files or accidental changes?
  • Have the relevant review comments been resolved?
  • Have the risks and impact of the change been considered?

How to use this checklist in practice

Not every change needs the same level of review.

A simple change in a C# class might not need a review of SQL queries or security settings. On the other hand, a change to a payment endpoint needs special attention to business rules, authorization, and failure handling.

The ideal is to adapt the checklist to the type of PR and automate the checks that don’t depend on human judgment.

That way, the team can focus the review on the problems that actually matter.

What should block a C# pull request?

Not every comment needs to hold up the merge.

A naming preference, for example, can usually be resolved with an analyzer or discussed without blocking the release.

A change that introduces a real production risk deserves different treatment.

Some examples of problems that can justify blocking a PR:

  • .Result or .Wait() in an async flow that can block threads or cause deadlocks.
  • async void outside event handlers, with no good reason for it.
  • Missing CancellationToken propagation in a long-running or critical operation that needs to support cancellation.
  • IDisposable or IAsyncDisposable resources with no clear disposal path.
  • Entity Framework queries with N+1 risk on important endpoints.
  • External input used in SQL, shell commands, or file paths without safe handling.
  • catch blocks that hide critical failures.
  • Passwords, tokens, or other sensitive data being logged.
  • Incompatible changes to public contracts with no migration or consumer update.
  • Critical business rule changes with no sufficient tests.

This doesn’t mean automatically blocking every single occurrence of these patterns.

For example, not every operation needs a CancellationToken, and using .Result doesn’t necessarily cause a deadlock in every context.

What determines the severity is the impact of the implementation.

A good review tells apart problems that need fixing before the merge from suggestions that could improve the code but don’t carry an immediate risk.

What are the best code review tools for C#?

There are different tools for reviewing C# code, and they don’t solve exactly the same problems.

Some use AI to analyze pull requests and suggest fixes. Others work through static analysis, checking code patterns, vulnerabilities, and maintenance problems.

The right choice depends on the team’s needs, the size of the codebase, and the tools already part of the development process.

The table below compares seven tools that can help with reviewing C# and .NET projects.

ToolType of analysisMain featuresBest for
KodusAI code reviewAutomatic PR review, custom rules, repository context, BYOK, and self-hostingC#/.NET teams that need to automate review and enforce internal standards
SonarQubeStatic analysisBug detection, vulnerabilities, code smells, and Quality GatesTeams that need to track quality and technical debt
GitHub Copilot Code ReviewAI code reviewPR comments, fix suggestions, and custom instructionsC# teams already on GitHub
CodeRabbitAI code reviewAutomatic reviews, PR summaries, and contextual analysisTeams that want to automate pull request feedback
NDependStatic analysis for .NETComplexity metrics, dependencies, architecture, and technical debtLarge C# projects with complex architectures
JetBrains ReSharperIDE analysisCode inspections, refactoring, and problem detectionDevelopers who want to improve code as they write it
Microsoft Roslyn AnalyzersStatic analysisQuality, style, and performance rules, plus diagnostics during the buildTeams that want native analysis in the .NET ecosystem

These tools aren’t necessarily direct competitors.

Kodus, CodeRabbit, and GitHub Copilot Code Review help automate pull request review. SonarQube, NDepend, and Roslyn Analyzers mainly work through rules and static analysis.

ReSharper works more directly inside the development environment, helping the developer catch problems while writing or changing code.

Static analysis, AI code review, or human review?

All three approaches can catch problems in a C# application, but each has its own strengths and limits.

Problem in C#Static analysisAI code reviewHuman review
Naming conventionsVery well suitedCan catch itUsually not needed
Incorrect use of async/awaitDetects known patternsCan catch contextual risksEvaluates the impact
N+1 queries in EF CoreCatches some cases with specific toolsCan flag risksValidates the actual behavior
Incorrect business rulesLimited coverageCan compare implementation against requirementsEssential for validating intent
Architecture decisionsChecks structural rulesCan analyze contextEssential for complex decisions
Exposed credentialsDetects patterns with the right toolsCan flag itEvaluates risk and the fix

A static analysis tool, for example, can consistently catch violations of coding rules. But it doesn’t necessarily understand why a given business rule was implemented that way.

An AI reviewer can analyze the context of a change and flag possible inconsistencies. Even so, its suggestions still need to be verified, especially for decisions that depend on external requirements or production behavior.

That’s why, in larger C# projects, combining static analysis, AI review, and human review tends to work better than relying on just one approach.

If you work specifically with ASP.NET Core APIs and Entity Framework, we also have a .NET code review guide that goes deeper on those topics.

Best practices for a C# code review

Beyond having a checklist, it’s worth organizing the review process so it doesn’t turn into a string of comments about low-value details.

A few practices help keep reviews consistent without piling extra work onto developers.

1. Automate code conventions

Naming, formatting, and style patterns shouldn’t depend on someone remembering to flag the same issue on every pull request.

In C#, many of these checks can be configured in .editorconfig and run through Roslyn Analyzers.

That lets you enforce conventions like PascalCase for classes, methods, and public properties, plus organization and style rules.

When these checks are automated, reviewers can spend more attention on the logic of the implementation.

2. Consider the context of the change

Before you start reviewing files, understand the goal of the pull request.

Read the description, check the ticket when there is one, and figure out what behavior was supposed to change.

This matters because code can be technically correct and still fail to solve the actual problem.

Also check whether the change affects another service, a shared library, or a contract used by different parts of the application.

3. Prioritize problems that affect behavior

Not every problem carries the same weight.

A query that could slow things down in production deserves more attention than a preference about how methods are organized.

The same goes for security, concurrency, exception handling, and business rule problems.

One way to make this clearer is to separate comments that require a fix from comments that are just suggestions.

That way, the PR author knows exactly what needs to be resolved before merging.

4. Review the risks specific to the .NET ecosystem

Some problems deserve special attention in C# applications.

async/await usage, resource management, Entity Framework Core queries, and null handling are common examples.

But context matters.

An ASP.NET Core API might need a careful review of authentication and authorization. A worker that processes large volumes of data might carry bigger risks around concurrency, memory use, and failure recovery.

The review should follow the characteristics of the application, not just a generic list of checks.

5. Write comments that explain the problem

Comments like “fix this” or “this implementation is bad” don’t help much the person who has to fix the code.

Whenever possible, explain what behavior is wrong, why it’s a risk, and what alternative could solve the problem.

For example, instead of just commenting “performance problem,” explain that a query inside a loop will run a database call for every record processed.

This kind of feedback makes the fix easier and cuts down on unnecessary back-and-forth.

6. Check the tests, not just the coverage number

Passing tests don’t guarantee a change is correct.

During review, check whether the tests actually verify the behavior the PR is supposed to implement.

A bug fix, for example, should come with a test that can reproduce the original failure.

Also consider invalid input, external dependency failures, and edge cases.

The goal isn’t just raising the coverage percentage, but reducing the risk of regressions.

7. Automate repetitive checks

Static analysis tools can handle conventions, diagnostics, and plenty of known language-level problems.

AI code review tools, like Kodus, can analyze pull request changes and apply rules specific to the repository.

This helps cut down on repetitive reviews, especially when several developers work in the same areas of the codebase.

Automation doesn’t remove the need for human review, but it can help the team focus its effort on the decisions that depend on context and product knowledge.

C# code review examples, by category

Now that we’ve covered the checklist and the best practices, let’s look at some examples of problems that can show up in C# pull requests.

The examples show situations that deserve attention during review, why they can cause problems, and how to improve the implementation.

1. Correctness before style

The first question in a code review should be: does the change actually do what it’s supposed to do?

Before you get into naming or organization, verify that the implemented behavior matches the requirements.

Imagine a change in a payment flow.

Problematic code:

invoice.Status = InvoiceStatus.Paid;
await paymentProvider.ChargeAsync(invoice.Total);

In this example, the invoice is marked as paid before the payment provider confirms the charge.

If the charge fails, the system can keep showing the invoice as paid.

A useful comment would be:

This marks the invoice as paid before the charge is confirmed. Can we update the status after the provider responds, or introduce an intermediate state like PaymentPending?

In a real flow, you’d also need to think about persistence, idempotency, and how failures are handled between the external charge and the database update.

The point of the review isn’t just reordering lines, but making sure the whole process stays consistent.

2. Null handling in C#

C# gives you tools to catch null-related problems before execution.

One of them is support for nullable reference types, which you can enable in .csproj:

<PropertyGroup>
    <Nullable>enable</Nullable>
</PropertyGroup>

With this feature, the compiler can warn you when it finds operations that risk a NullReferenceException.

But that doesn’t remove the need to review the code.

Some common problems:

  • ! used to silence a warning with no real guarantee behind it.
  • Methods that return null without reflecting that in the type.
  • Accessing a property on an object that might not exist.
  • FirstOrDefault() used without handling a missing result.
  • Accessing a nonexistent key in a Dictionary.

Problematic code:

var customer = customers.FirstOrDefault(
    c => c.Id == customerId);

return customer.Email.ToLowerInvariant();

If no customer is found, customer will be null.

A safer implementation:

var customer = customers.FirstOrDefault(
    c => c.Id == customerId);

if (customer is null)
{
    throw new CustomerNotFoundException(customerId);
}

return customer.Email.ToLowerInvariant();

Here, the missing customer is handled explicitly.

If Email can also be null, the model should represent that with string?, and the application needs to decide how to handle it.

For more detail, see Microsoft’s documentation on nullable reference types.

3. Async code and cancellation

Async operations show up constantly in .NET applications, especially in HTTP calls, database queries, and file processing.

During review, look for:

  • Unnecessary use of .Result or .Wait().
  • async void methods outside event handlers.
  • Async operations started without being awaited or otherwise tracked to completion.
  • A CancellationToken received but never propagated.
  • Independent operations run sequentially with no real need to.

Problematic code:

public UserProfile GetProfile(Guid userId)
{
    var user = _users.GetByIdAsync(userId).Result;
    var orders = _orders.GetRecentAsync(userId).Result;

    return new UserProfile(user, orders);
}

Using .Result blocks the thread while it waits for the operation.

Depending on the environment, that can cause deadlocks or reduce the application’s ability to handle concurrent requests.

An alternative:

public async Task<UserProfile> GetProfileAsync(
    Guid userId,
    CancellationToken cancellationToken)
{
    var userTask = _users.GetByIdAsync(
        userId, cancellationToken);

    var ordersTask = _orders.GetRecentAsync(
        userId, cancellationToken);

    await Task.WhenAll(userTask, ordersTask);

    return new UserProfile(
        await userTask,
        await ordersTask);
}

Here, the operations start without blocking the thread, and the CancellationToken is propagated.

The example assumes the two calls are independent and can safely run in parallel, without sharing a DbContext or another resource that doesn’t support concurrent operations.

That’s a distinction worth checking for during review.

Microsoft documents these conventions in the task-based asynchronous pattern.

4. Resource disposal

.NET uses a garbage collector to manage memory, but that doesn’t mean every external resource gets released at the right time.

Streams, connections, and other objects that implement IDisposable or IAsyncDisposable need a defined lifetime.

Problematic code:

var stream = File.OpenRead(path);

return await JsonSerializer.DeserializeAsync<Order>(stream);

The stream gets opened, but there’s no explicit disposal after the operation.

A better implementation:

await using var stream = File.OpenRead(path);

return await JsonSerializer.DeserializeAsync<Order>(
    stream,
    cancellationToken: cancellationToken);

await using guarantees async disposal when the object implements IAsyncDisposable, including when an exception is thrown.

Another spot that deserves attention is HttpClient.

Creating a new instance for every request can cause connection management problems. In many ASP.NET Core applications, using IHttpClientFactory is the better choice.

The question during review isn’t just “is there a Dispose()?”, but understanding who owns the resource’s lifetime.

See the using statement documentation.

5. Entity Framework Core and LINQ

Query performance problems aren’t always obvious just from reading the code.

A query can run fine during development and start showing problems once the data volume grows.

A well-known example is the N+1 problem.

Imagine an application with lazy loading enabled.

Problematic code:

var orders = await _db.Orders
    .ToListAsync(cancellationToken);

foreach (var order in orders)
{
    Console.WriteLine(order.Customer.Name);
}

If the Customer relationship uses lazy loading and the customers aren’t loaded yet, each property access can trigger an extra database query.

In this scenario, the application runs one query to fetch the orders, then more queries to fetch each related customer.

This behavior depends on how EF Core’s loading is configured. Without lazy loading, this example wouldn’t necessarily produce N+1 queries.

An alternative is to load the relationships you need up front:

var orders = await _db.Orders
    .Include(order => order.Customer)
    .Where(order => order.Status == OrderStatus.Open)
    .ToListAsync(cancellationToken);

Another option, when you don’t need the full entities, is to use a projection.

var orders = await _db.Orders
    .Where(order => order.Status == OrderStatus.Open)
    .Select(order => new OrderSummary(
        order.Id,
        order.Number,
        order.Customer.Name,
        order.Total))
    .ToListAsync(cancellationToken);

The projection lets you select only the fields you actually need.

During code review, also watch for:

  • Queries materialized too early with ToList() or ToArray().
  • Navigating relationships inside loops.
  • Missing pagination.
  • Unnecessary tracking.
  • Queries that return more data than the application actually uses.

The EF Core documentation covers the differences between eager loading, explicit loading, and lazy loading.

6. Modern C# language features

C# keeps evolving, and the more recent versions introduced features that also deserve attention during review.

This doesn’t mean every piece of code needs to use the newest syntax, but the team should understand how these features affect behavior and maintainability.

Records and value equality

Records let you represent data with value-equality semantics.

public record OrderSummary(
    Guid Id,
    string Number,
    decimal Total);

var updated = summary with
{
    Total = summary.Total + fee
};

In this example, updated is a new instance created from summary.

The with expression doesn’t mutate the original record, though the copy is shallow and any internally referenced objects can still be shared.

During review, check whether value-equality semantics are the right fit, and whether the code doesn’t incorrectly rely on reference equality.

Primary constructors

Since C# 12, classes and structs can declare parameters directly in the type definition.

public class OrderProcessor(
    IOrderRepository repository,
    ILogger<OrderProcessor> logger)
{
    public async Task ProcessAsync(
        Guid orderId,
        CancellationToken cancellationToken)
    {
        logger.LogInformation(
            "Processing order {OrderId}",
            orderId);

        var order = await repository.GetAsync(
            orderId,
            cancellationToken);
    }
}

In this example, the constructor parameters are available throughout the class.

When a parameter is used by an instance member, as happens in this method, the compiler can store it in an auto-generated private field.

That doesn’t mean every primary constructor parameter always creates a field.

During review, mainly look for unnecessary captures and cases where the same value ends up stored more than once.

Pattern matching

Pattern matching lets you express conditions more clearly, but it can also hide unhandled cases.

var fee = order.Status switch
{
    OrderStatus.Open => 0m,
    OrderStatus.Shipped => 2.5m,
    _ => 0m
};

In this example, any new value of OrderStatus will fall into the default case.

Depending on the business rule, that can hide behavior that should have been implemented explicitly.

The reviewer needs to judge whether the fallback makes sense, or whether a new state should instead produce an identifiable failure.

Collection expressions

Since C# 12, you can use collection expressions:

int[] numbers = [1, 2, 3];

This syntax simplifies creating collections in several contexts.

The main thing to review here is understanding the target type, the allocation implications where relevant, and keeping it consistent with the project’s conventions.

The field keyword in C# 14

C# 14 introduced the field keyword, which lets you access a property’s backing field without declaring it explicitly.

public string Name
{
    get;
    set => field = value.Trim();
}

The feature cuts down on manually written private fields.

But there’s a catch: if the type already has a member named field, the code can become ambiguous to readers, because the compiler interprets that identifier as the keyword in certain contexts.

It’s worth checking for naming conflicts here, and making sure the property’s behavior stays clear.

7. Exceptions and logs

Exception handling also deserves attention during code review.

A catch block can look like a safety measure, but when used incorrectly, it can hide failures that should have stopped the operation.

Problematic code:

try
{
    await processor.ProcessAsync(command);
}
catch (Exception ex)
{
    _logger.LogError(ex.Message);
}

This code catches any exception, logs just the message, and keeps executing.

Besides hiding the failure from the caller, the log loses important information, like the stack trace.

An alternative:

try
{
    await processor.ProcessAsync(
        command,
        cancellationToken);
}
catch (PaymentProviderException ex)
{
    _logger.LogError(
        ex,
        "Payment provider failed for order {OrderId}",
        command.OrderId);

    throw;
}

Now the code handles a specific exception type, logs useful context, and preserves the stack trace when it rethrows the error.

Even so, this pattern doesn’t need to be repeated in every method.

In ASP.NET Core applications, for example, it often makes more sense to use global exception handling, to avoid duplicate logs and keep error responses centralized.

The application shouldn’t hide important failures, and the logs should help investigate the problem without exposing sensitive data.

8. Security and input validation

A key part of C# code review is figuring out where external data enters the application.

That includes:

  • HTTP requests.
  • Route parameters and query strings.
  • Headers and webhooks.
  • Files uploaded by users.
  • Messages received from queues.
  • Environment variables.
  • Integrations with external services.

This input needs to be handled according to its context.

A common example is building a SQL query through string concatenation.

Problematic code:

var sql =
    $"SELECT * FROM Users WHERE Email = '{email}'";

If email comes from external input, the code can be vulnerable to SQL injection.

An alternative with Entity Framework Core:

var user = await _db.Users
    .SingleOrDefaultAsync(
        user => user.Email == email,
        cancellationToken);

Here, EF Core parameterizes the value used in the query.

But security isn’t just about SQL injection.

During review, check whether endpoints require the right permissions, whether model binding allows unwanted changes to properties, and whether error responses or logs expose sensitive information.

9. Tests

Tests should demonstrate that the changed behavior works as expected.

During review, don’t just look at the coverage percentage.

Ask:

  • Would the test fail without the fix in place?
  • Does it cover the scenario that motivated the PR?
  • Were edge cases considered?
  • Are async operations awaited correctly?
  • Are external dependencies under control?
  • Does the test name explain the expected behavior?

A name like this one tells you almost nothing:

[Fact]
public async Task Test1()

A more descriptive name helps convey the intent:

[Fact]
public async Task CreateOrderAsync_returns_error_when_customer_is_missing()

For bug fixes, look for a regression test.

For refactors, check whether the existing tests still describe the expected behavior.

And for new business rules, check whether the main success and failure paths were considered.

10. Automate style with analyzers

A lot of style discussions can be settled before anyone even opens a pull request.

.NET ships with analyzers that can catch problems related to quality, maintainability, and code organization.

These rules can be configured in .editorconfig.

For example:

[*.cs]

dotnet_diagnostic.CA1822.severity = warning

dotnet_style_qualification_for_field = false:suggestion

dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion

You can also wire these checks into the build and the CI pipeline, depending on how the project is set up.

Microsoft’s documentation explains how to configure code analysis rules.

Once these checks run automatically, code review stops depending on repetitive formatting comments and can focus on more relevant technical decisions.

Frequently asked questions about C# code review

What should you check in a C# code review?

A C# code review should cover the correctness of the implementation, proper use of async/await, null handling, resource management, security, performance, and tests.

In .NET applications, it’s also worth reviewing Entity Framework Core queries, API contracts, and CancellationToken propagation when it’s needed.

The checklist should be adapted to the type of change.

What’s the difference between AI code review and static analysis in C#?

Static analysis uses rules and checks to catch known problems in the code, such as style violations, certain bugs, and maintainability risks.

AI code review uses language models to analyze changes and surface possible problems based on the available context.

The two approaches can complement each other, but neither guarantees catching every bug.

What is the best AI code review tool for C#?

It depends on what the team needs.

GitHub Copilot Code Review can be a good fit for teams already working on GitHub. CodeRabbit offers automatic reviews and contextual feedback on pull requests.

Kodus can be a good fit for teams that need to configure internal review rules, bring their own models with BYOK, and have self-hosting options.

The choice should factor in integration, suggestion quality, privacy, and control over the review rules.

Does Kodus support large C# teams?

Kodus is built for teams that need to standardize review across multiple repositories and projects.

With Kody Rules, you can configure specific rules and adjust review behavior per repository or directory.

The platform also offers BYOK and self-hosting options, which can matter for organizations with specific infrastructure and security requirements.

Does Kodus replace SonarQube in C# projects?

Not necessarily.

SonarQube mainly works through static analysis, quality rules, and automated checks.

Kodus uses AI to analyze pull requests and apply contextual rules configured by the team.

In a lot of setups, it makes sense to run both: one for static checks, the other for analyzing possible problems in the actual changes.

Can AI catch async/await problems in C#?

An AI code review tool can catch patterns like misuse of .Result, .Wait(), async void, and missing CancellationToken propagation.

That said, not every concurrency and performance problem can be confirmed just by reading the code.

Depending on the scenario, you still need to run tests and observe the application’s behavior under load.

Can AI catch Entity Framework Core performance problems?

AI review tools can flag patterns that signal performance risk, such as queries inside loops, early materialization, and unnecessary data loading.

But spotting a pattern doesn’t prove the real-world impact.

Confirming the problem usually means inspecting the generated SQL, the execution plan, and the application’s metrics.

Are there free code review tools for C#?

Yes.

Roslyn Analyzers, the analysis features built into the .NET SDK, Roslynator, and StyleCop Analyzers are all free options that cover different aspects of C# code.

Kodus also has an open-source version on GitHub, which you can run self-hosted.