Sharkable 0.0.24
dotnet add package Sharkable --version 0.0.24
NuGet\Install-Package Sharkable -Version 0.0.24
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sharkable" Version="0.0.24" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sharkable --version 0.0.24
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sharkable, 0.0.24"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Sharkable as a Cake Addin #addin nuget:?package=Sharkable&version=0.0.24 // Install Sharkable as a Cake Tool #tool nuget:?package=Sharkable&version=0.0.24
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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
for more use sample please see Sharkable.Sample project
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.AspNetCore.OpenApi (>= 8.0.8)
- Swashbuckle.AspNetCore (>= 6.7.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Sharkable:
Package | Downloads |
---|---|
Sharkable.AutoCrud.SqlSugar
a dotnet minimal api framework collection aimed to support aot |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.0.24 | 113 | 10/2/2024 |
0.0.23 | 109 | 9/27/2024 |
0.0.21 | 100 | 9/25/2024 |
0.0.20 | 100 | 9/24/2024 |
0.0.19 | 106 | 9/24/2024 |
0.0.18 | 106 | 9/24/2024 |
0.0.17 | 95 | 9/23/2024 |
0.0.16 | 86 | 9/21/2024 |
0.0.15 | 89 | 9/19/2024 |
0.0.14 | 85 | 9/19/2024 |
0.0.13 | 93 | 9/19/2024 |
0.0.12 | 87 | 9/18/2024 |
0.0.11 | 95 | 9/17/2024 |
0.0.10 | 97 | 9/17/2024 |
0.0.9 | 96 | 9/16/2024 |
0.0.8 | 124 | 9/16/2024 |
0.0.6 | 146 | 9/12/2024 |
0.0.4 | 154 | 9/11/2024 |
0.0.2 | 148 | 9/3/2024 |
0.0.1 | 136 | 9/2/2024 |
add swagger ui options