Sharkable 0.3.1
See the version list below for details.
dotnet add package Sharkable --version 0.3.1
NuGet\Install-Package Sharkable -Version 0.3.1
<PackageReference Include="Sharkable" Version="0.3.1" />
<PackageVersion Include="Sharkable" Version="0.3.1" />
<PackageReference Include="Sharkable" />
paket add Sharkable --version 0.3.1
#r "nuget: Sharkable, 0.3.1"
#:package Sharkable@0.3.1
#addin nuget:?package=Sharkable&version=0.3.1
#tool nuget:?package=Sharkable&version=0.3.1
Sharkable
a dotnet minimal api framework collection
Usage
automatic dependency injection
//first add extension
using Sharkable
builder.Services.AddShark();
//for aot users please specify assemblies by youself and avoid code trim
build.Services.AddShark([typeof(Program).Assembly]);
[ScopedService] //inject class as a scoped service by the given attribute
public class Monitor : IMonitor
{
public void Show()
{
...
}
}
//map an endpoint and it works!
app.MapGet("/monitor",([FromServices]IMonitor monitor) =>
{
monitor.Show();
});
endpoint auto mapper (new style)
create a new class
public class TestEndpoint : ISharkEndpoint
{
public void AddRoutes(IEndpointRouteBuilder app)
{
app.MapGet("show", ()=>"test result");
}
}
//will now generate a http get method with the url
// api/test/show
endpoint auto mapper (old style)
create a new class
[SharkEndpoint]
public class TestEndpoint
{
[SharkMethod("show", SharkHttpMethod.GET)]
public void Show()
{
...
}
}
//will now generate a http get method with the url
// api/test/show
idempotent retries via Idempotency-Key
opt-in middleware that lets clients safely retry unsafe HTTP requests. when a client
sends the Idempotency-Key header on a POST / PUT / PATCH / DELETE request, the
first response is cached; subsequent requests with the same key replay it. reusing a
key with a different payload returns 422; concurrent same-key requests return 409 with
Retry-After: 1.
builder.Services.AddShark(opt =>
{
opt.EnableIdempotency = true;
opt.ConfigureIdempotency(o =>
{
o.Ttl = TimeSpan.FromHours(24); // default
o.MaxResponseSize = 1_048_576; // default 1 MiB
});
});
see docs/superpowers/specs/2026-06-26-idempotency-middleware-design.md for the full
specification including edge cases and limitations.
for more use sample please see Sharkable.Sample project
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- FluentValidation (>= 12.1.1)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 10.0.7)
- Microsoft.AspNetCore.OpenApi (>= 10.0.7)
- Scalar.AspNetCore (>= 2.14.14)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Sharkable:
| Package | Downloads |
|---|---|
|
Sharkable.AutoCrud.SqlSugar
AutoCrud SqlSugar plugin for Sharkable — automatic CRUD API generation with health check |
|
|
Sharkable.Cache.Redis
Redis-backed distributed stores for Sharkable — idempotency and rate limiting. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.5.7 | 40 | 7/11/2026 |
| 0.5.6 | 149 | 7/3/2026 |
| 0.5.5 | 153 | 7/2/2026 |
| 0.5.4 | 136 | 7/1/2026 |
| 0.5.3 | 149 | 6/30/2026 |
| 0.5.2 | 94 | 6/30/2026 |
| 0.5.1 | 106 | 6/29/2026 |
| 0.4.1 | 143 | 6/28/2026 |
| 0.4.0 | 131 | 6/28/2026 |
| 0.3.2 | 93 | 6/27/2026 |
| 0.3.1 | 147 | 6/27/2026 |
| 0.2.0 | 109 | 6/8/2026 |
| 0.1.0 | 108 | 6/8/2026 |
| 0.0.24 | 284 | 10/2/2024 |
| 0.0.23 | 254 | 9/27/2024 |
| 0.0.21 | 218 | 9/25/2024 |
| 0.0.20 | 212 | 9/24/2024 |