Sharkable 0.0.14
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Sharkable --version 0.0.14
NuGet\Install-Package Sharkable -Version 0.0.14
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.14" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sharkable --version 0.0.14
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sharkable, 0.0.14"
#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.14 // Install Sharkable as a Cake Tool #tool nuget:?package=Sharkable&version=0.0.14
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
- No dependencies.
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 | 101 | 10/2/2024 |
0.0.23 | 97 | 9/27/2024 |
0.0.21 | 89 | 9/25/2024 |
0.0.20 | 89 | 9/24/2024 |
0.0.19 | 93 | 9/24/2024 |
0.0.18 | 90 | 9/24/2024 |
0.0.17 | 85 | 9/23/2024 |
0.0.16 | 78 | 9/21/2024 |
0.0.15 | 76 | 9/19/2024 |
0.0.14 | 75 | 9/19/2024 |
0.0.13 | 84 | 9/19/2024 |
0.0.12 | 78 | 9/18/2024 |
0.0.11 | 83 | 9/17/2024 |
0.0.10 | 90 | 9/17/2024 |
0.0.9 | 86 | 9/16/2024 |
0.0.8 | 117 | 9/16/2024 |
0.0.6 | 136 | 9/12/2024 |
0.0.4 | 145 | 9/11/2024 |
0.0.2 | 139 | 9/3/2024 |
0.0.1 | 129 | 9/2/2024 |
add openapi and swagger support