Skip to content
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

[Breaking change]: Output Caching renames in 7.0 RC2 #492

Open
2 of 3 tasks
sebastienros opened this issue Sep 13, 2022 · 0 comments
Open
2 of 3 tasks

[Breaking change]: Output Caching renames in 7.0 RC2 #492

sebastienros opened this issue Sep 13, 2022 · 0 comments
Labels
7.0.0 Announcement Breaking change Documented The breaking change has been published to the .NET Core docs

Comments

@sebastienros
Copy link
Member

Description

From 7.0 RC1 to 7.0 RC2 some APIs have changed to better represent their intent.

dotnet/aspnetcore#43892

Version

.NET 7 RC2

Previous behavior

  • OutputCachePolicyBuilder.VaryByQuery() was additive: every call would add more query string keys to vary by.

New behavior

  • OutputCachePolicyBuilder.SetVaryByQuery() is replacing existing query string keys.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load/execute or different run-time behavior.
  • Source incompatible: Source code may encounter a breaking change in behavior when targeting the new runtime/component/SDK, such as compile errors or different run-time behavior.
  • Behavioral change: Existing code and binaries may experience different run-time behavior.

Reason for change

This change was made to improve the consistency of method names and to remove ambiguity in their behavior.

Recommended action

It is recommended you recompile any projects built with an earlier SDK. If any of these method names were referenced directly, the source should be updated to reflect the new names.

Affected APIs

  • Removed: Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.OutputCachePolicyBuilder()
  • Removed: Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.Clear()
  • Renamed: Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.AllowLocking() to SetLocking()
  • Renamed: Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.VaryByRouteValue() to SetVaryByRouteValue()
  • Renamed: Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.VaryByQuery() to SetVaryByQuery()
  • Renamed: Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder.VaryByHeader() to SetVaryByHeader()
  • Added: Microsoft.AspNetCore.OutputCaching.CacheVaryByRules.VaryByHost
  • Added: Microsoft.AspNetCore.OutputCaching.OutputCacheOptions.AddPolicy(string name, Action<OutputCachePolicyBuilder> build, bool excludeDefaultPolicy)
  • Added: Microsoft.AspNetCore.OutputCaching.OutputCacheOptions.AddBasePolicy(Action<OutputCachePolicyBuilder> build, bool excludeDefaultPolicy)
  • Added: Microsoft.Extensions.DependencyInjection.OutputCacheConventionBuilderExtensions.CacheOutput<TBuilder>(this TBuilder builder, Action<OutputCachePolicyBuilder> policy, bool excludeDefaultPolicy)
@ghost ghost locked as resolved and limited conversation to collaborators Sep 13, 2022
@gewarren gewarren added the Documented The breaking change has been published to the .NET Core docs label Oct 10, 2022
@guardrex guardrex added the 7.0.0 label Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
7.0.0 Announcement Breaking change Documented The breaking change has been published to the .NET Core docs
Projects
None yet
Development

No branches or pull requests

3 participants