Repository: dotnet/aspnetcore
File: src/Components/Server/src/Circuits/CircuitHost.cs (C#)

Code before:
        if (circuitHandlers.Count == 0)
        {
            // If there are no registered handlers, there is no need to allocate a context on each call.
            return static handler => handler();
        }

        var result = static (CircuitInboundActivityContext context) => context.Handler();

        for (var i = circuitHandlers.Count - 1; i >= 0; i--)
        {
            var next = result;
            result = circuitHandlers[i].CreateInboundActivityHandler(next);
        }

        return handler => result(new(handler, circuit));
    }

    private void AssertInitialized()
    {
        if (!_initialized)
        {
            throw new InvalidOperationException("Circuit is being invoked prior to initialization.");
        }
    }

    internal bool IsDisposed() =>_disposed;

    private void AssertNotDisposed()
    {
#pragma warning disable CA1513 // Use ObjectDisposedException throw helper
        if (_disposed)
        {
            throw new ObjectDisposedException(objectName: null);
        }
#pragma warning restore CA1513 // Use ObjectDisposedException throw helper
    }

    // We want to notify the client if it's still connected, and then tear-down the circuit.
    private async void ReportAndInvoke_UnhandledException(object sender, Exception e)
    {
        await ReportUnhandledException(e);
        UnhandledException?.Invoke(this, new UnhandledExceptionEventArgs(e, isTerminating: false));
    }

    // An unhandled exception from the renderer is always fatal because it came from user code.
    // We want to notify the client if it's still connected, and then tear-down the circuit.
    private async void SynchronizationContext_UnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
        await ReportUnhandledException((Exception)e.ExceptionObject);
        UnhandledException?.Invoke(this, e);
    }

Review comment (suggestion):
Missing space between '=>' and '_disposed'. Should be 'internal bool IsDisposed() => _disposed;'
```suggestion
    internal bool IsDisposed() => _disposed;
```

Code after:
        if (circuitHandlers.Count == 0)
        {
            // If there are no registered handlers, there is no need to allocate a context on each call.
            return static handler => handler();
        }

        var result = static (CircuitInboundActivityContext context) => context.Handler();

        for (var i = circuitHandlers.Count - 1; i >= 0; i--)
        {
            var next = result;
            result = circuitHandlers[i].CreateInboundActivityHandler(next);
        }

        return handler => result(new(handler, circuit));
    }

    private void AssertInitialized()
    {
        if (!_initialized)
        {
            throw new InvalidOperationException("Circuit is being invoked prior to initialization.");
        }
    }

    private void AssertNotDisposed()
    {
#pragma warning disable CA1513 // Use ObjectDisposedException throw helper
        if (_disposed)
        {
            throw new ObjectDisposedException(objectName: null);
        }
#pragma warning restore CA1513 // Use ObjectDisposedException throw helper
    }

    // We want to notify the client if it's still connected, and then tear-down the circuit.
    private async void ReportAndInvoke_UnhandledException(object sender, Exception e)
    {
        await ReportUnhandledException(e);
        UnhandledException?.Invoke(this, new UnhandledExceptionEventArgs(e, isTerminating: false));
    }

    // An unhandled exception from the renderer is always fatal because it came from user code.
    // We want to notify the client if it's still connected, and then tear-down the circuit.
    private async void SynchronizationContext_UnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
        await ReportUnhandledException((Exception)e.ExceptionObject);
        UnhandledException?.Invoke(this, e);
    }

    private async Task ReportUnhandledException(Exception exception)