Repository: dotnet/aspnetcore
File: src/Components/Components/src/OwningComponentBase.cs (C#)

Code before:
    /// Gets a value determining if the component and associated services have been disposed.
    /// </summary>
    protected bool IsDisposed { get; private set; }

    /// <summary>
    /// Gets the scoped <see cref="IServiceProvider"/> that is associated with this component.
    /// </summary>
    protected IServiceProvider ScopedServices
    {
        get
        {
            if (ScopeFactory == null)
            {
                throw new InvalidOperationException("Services cannot be accessed before the component is initialized.");
            }

            ObjectDisposedException.ThrowIf(IsDisposed, this);

            _scope ??= ScopeFactory.CreateAsyncScope();
            return _scope.Value.ServiceProvider;
        }
    }

    /// <summary>
    /// Releases the service scope used by the component.
    /// </summary>
    void IDisposable.Dispose()
    {
        Dispose(disposing: true);
        GC.SuppressFinalize(this);
    }

    /// <summary>
    /// Releases the service scope used by the component.
    /// </summary>
    /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
    protected virtual void Dispose(bool disposing)
    {
        if (!IsDisposed)
        {
            if (disposing)
            {
                if (_scope.HasValue)
                {
                    if (_scope.Value is IDisposable disposable)
                    {
                        disposable.Dispose();
                    }
                    _scope = null;
                }
            }

Review comment (suggestion):
I sense the AI working here 😄

These methods are not public, so no need to document it. In .NET when a method is an interface implementation, it can use `/// <inhertidoc />` to tell it to use the same text as the interface definition.

Code after:
    /// Gets a value determining if the component and associated services have been disposed.
    /// </summary>
    protected bool IsDisposed { get; private set; }

    /// <summary>
    /// Gets the scoped <see cref="IServiceProvider"/> that is associated with this component.
    /// </summary>
    protected IServiceProvider ScopedServices
    {
        get
        {
            if (ScopeFactory == null)
            {
                throw new InvalidOperationException("Services cannot be accessed before the component is initialized.");
            }

            ObjectDisposedException.ThrowIf(IsDisposed, this);

            _scope ??= ScopeFactory.CreateAsyncScope();
            return _scope.Value.ServiceProvider;
        }
    }

    /// <inhertidoc />
    void IDisposable.Dispose()
    {
        Dispose(disposing: true);
        GC.SuppressFinalize(this);
    }

    /// <summary>
    /// Releases the service scope used by the component.
    /// </summary>
    /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
    protected virtual void Dispose(bool disposing)
    {
        if (!IsDisposed)
        {
            if (disposing && _scope.HasValue && _scope.Value is IDisposable disposable)
            {
                disposable.Dispose();
                _scope = null;
            }

            IsDisposed = true;
        }
    }

    /// <inhertidoc />
    async ValueTask IAsyncDisposable.DisposeAsync()
    {