https://github.com/creyke/softkill
Kill your methods softly
https://github.com/creyke/softkill
aspnet-core aspnet-web-api dotnet dotnet-core
Last synced: 3 months ago
JSON representation
Kill your methods softly
- Host: GitHub
- URL: https://github.com/creyke/softkill
- Owner: creyke
- License: mit
- Created: 2021-01-11T13:17:41.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-06T10:46:36.000Z (over 2 years ago)
- Last Synced: 2025-02-12T05:47:36.701Z (5 months ago)
- Topics: aspnet-core, aspnet-web-api, dotnet, dotnet-core
- Language: C#
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SoftKill
Kill your ASP.NET API methods softly[](https://www.nuget.org/packages/SoftKill)
# Overview
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.# Usage
## Installing
Install the [NuGet package](https://www.nuget.org/packages/SoftKill) into an ASP.NET project with a package manager.### .NET CLI
```dotnet add package SoftKill```### Package Manager
```Install-Package SoftKill```## Enable SoftKill in Startup
```csharp
app.UseRouting();
app.UseSoftKill();
```## Condemn your method
```csharp
[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 Get()
```