Repository: dotnet/efcore
File: src/EFCore.Design/Migrations/Design/MigrationsScaffolder.cs (C#)

Code before:
    /// </summary>
    /// <param name="projectDir">The project's root directory.</param>
    /// <param name="rootNamespace">The project's root namespace.</param>
    /// <param name="force">Don't check to see if the migration has been applied to the database.</param>
    /// <param name="dryRun">If <see langword="true" />, then nothing is actually written to disk.</param>
    /// <returns>The removed migration files.</returns>
    public virtual MigrationFiles RemoveMigration(string projectDir, string rootNamespace, bool force, bool dryRun)
        => RemoveMigration(projectDir, rootNamespace, force, offline: false, language: null, dryRun: false);

    /// <summary>
    ///     Removes the previous migration.
    /// </summary>
    /// <param name="projectDir">The project's root directory.</param>
    /// <param name="rootNamespace">The project's root namespace.</param>
    /// <param name="force">Don't check to see if the migration has been applied to the database.</param>
    /// <param name="language">The project's language.</param>
    /// <param name="dryRun">If <see langword="true" />, then nothing is actually written to disk.</param>
    /// <returns>The removed migration files.</returns>
    [Obsolete("Use the overload that accepts the offline parameter.")]
    public virtual MigrationFiles RemoveMigration(
        string projectDir,
        string? rootNamespace,
        bool force,
        string? language,
        bool dryRun)
        => RemoveMigration(projectDir, rootNamespace, force, offline: false, language, dryRun);

    /// <inheritdoc />
    public virtual MigrationFiles RemoveMigration(
        string projectDir,
        string? rootNamespace,
        bool force,
        bool offline,
        string? language,
        bool dryRun)
    {
        var files = new MigrationFiles();

        var modelSnapshot = Dependencies.MigrationsAssembly.ModelSnapshot;
        if (modelSnapshot == null)
        {
            throw new OperationException(DesignStrings.NoSnapshot);
        }

        var codeGenerator = Dependencies.MigrationsCodeGeneratorSelector.Select(language);

        IModel? model = null;
        var migrations = Dependencies.MigrationsAssembly.Migrations
            .Select(m => Dependencies.MigrationsAssembly.CreateMigration(m.Value, _activeProvider))
            .ToList();
        if (migrations.Count != 0)

Review comment (suggestion):
@copilot Instead of obsoleting this overload move `offline` to the end and make it optional

Code after:
    /// </summary>
    /// <param name="projectDir">The project's root directory.</param>
    /// <param name="rootNamespace">The project's root namespace.</param>
    /// <param name="force">Revert the migration if it has been applied to the database.</param>
    /// <param name="dryRun">If <see langword="true" />, then nothing is actually written to disk.</param>
    /// <returns>The removed migration files.</returns>
    public virtual MigrationFiles RemoveMigration(string projectDir, string rootNamespace, bool force, bool dryRun)
        => RemoveMigration(projectDir, rootNamespace, force, language: null, dryRun: dryRun, offline: false);

    /// <summary>
    ///     Removes the previous migration.
    /// </summary>
    /// <param name="projectDir">The project's root directory.</param>
    /// <param name="rootNamespace">The project's root namespace.</param>
    /// <param name="force">Revert the migration if it has been applied to the database.</param>
    /// <param name="language">The project's language.</param>
    /// <param name="dryRun">If <see langword="true" />, then nothing is actually written to disk.</param>
    /// <param name="offline">Remove the migration without connecting to the database.</param>
    /// <returns>The removed migration files.</returns>
    public virtual MigrationFiles RemoveMigration(
        string projectDir,
        string? rootNamespace,
        bool force,
        string? language,
        bool dryRun = false,
        bool offline = false)
    {
        var files = new MigrationFiles();

        var modelSnapshot = Dependencies.MigrationsAssembly.ModelSnapshot;
        if (modelSnapshot == null)
        {
            throw new OperationException(DesignStrings.NoSnapshot);
        }

        var codeGenerator = Dependencies.MigrationsCodeGeneratorSelector.Select(language);

        IModel? model = null;
        var migrations = Dependencies.MigrationsAssembly.Migrations
            .Select(m => Dependencies.MigrationsAssembly.CreateMigration(m.Value, _activeProvider))
            .ToList();
        if (migrations.Count != 0)
        {
            var migration = migrations[^1];
            model = Dependencies.SnapshotModelProcessor.Process(migration.TargetModel);

            if (!Dependencies.MigrationsModelDiffer.HasDifferences(
                    model.GetRelationalModel(), Dependencies.SnapshotModelProcessor.Process(modelSnapshot.Model).GetRelationalModel()))
            {
                var applied = false;