Skip to content

Refactor Redis Clear Command to Use New CommandOptions API #4133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2025

Conversation

ismaeel-ch
Copy link
Contributor

This update refactors the WithCommand method usage in RedisResourceBuilderExtensions to align with the latest .NET Aspire conventions.

Replaced obsolete method overload of WithCommand with the updated overload that uses CommandOptions.

Ensured UpdateState, IconName, and IconVariant are now passed through the new CommandOptions object.

Maintained existing logic for cache clearing and command state update.

This change ensures compatibility with the current Aspire APIs and resolves potential warnings from obsolete API usage.

@ismaeel-ch
Copy link
Contributor Author

@dotnet-policy-service agree

@IEvangelist IEvangelist requested a review from Copilot July 22, 2025 12:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Redis clear command implementation to use the new CommandOptions API instead of the obsolete method overload. The change aligns with the latest .NET Aspire conventions and resolves potential warnings from deprecated API usage.

  • Replaced obsolete WithCommand method parameters with new CommandOptions object
  • Maintained all existing functionality for cache clearing and command state updates
  • Removed some unnecessary blank lines for cleaner code formatting
Comments suppressed due to low confidence (1)

docs/fundamentals/snippets/custom-commands/AspireApp/AspireApp.AppHost/RedisResourceBuilderExtensions.cs:13

  • [nitpick] Consider using a more descriptive variable name than 'commandOptions'. Since this is specifically for a clear cache command, 'clearCacheOptions' would be more meaningful.
        var commandOptions = new CommandOptions

@IEvangelist IEvangelist merged commit 33dba6e into dotnet:main Jul 22, 2025
8 checks passed
@ismaeel-ch ismaeel-ch deleted the patch-1 branch July 22, 2025 14:17
@ismaeel-ch ismaeel-ch restored the patch-1 branch July 22, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants