Kill your ASP.NET API methods softly
SoftKill allows you to gently retire API methods by placing an attribute on them which defines when their response time should begin to degrade, the speed at which this occurs, and a final condemnation date after which the method will return an HTTP 410 Gone status.
Install the NuGet package into an ASP.NET project with a package manager.
dotnet add package SoftKill
Install-Package SoftKill
app.UseRouting();
app.UseSoftKill();[HttpGet]
[Obsolete("This method has a better alternative.")]
[KillSoftly(
new[] { 2021, 01, 01 }, // DegredationDate
7, // DegredationWindowDays
2, // DegredationSeconds
new[] { 2021, 02, 01 })] // CondemnationDate
public IEnumerable<WeatherForecast> Get()