Scribbly.Stencil.Generator
0.1.0
Suggested Alternatives
Additional Details
Scribbly.Stencil.Generator is now part of Scribbly.Stencil and should be removed from your project starting with version 0.1.4
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 Scribbly.Stencil.Generator --version 0.1.0
NuGet\Install-Package Scribbly.Stencil.Generator -Version 0.1.0
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="Scribbly.Stencil.Generator" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Scribbly.Stencil.Generator" Version="0.1.0" />
<PackageReference Include="Scribbly.Stencil.Generator" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Scribbly.Stencil.Generator --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Scribbly.Stencil.Generator, 0.1.0"
#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.
#:package Scribbly.Stencil.Generator@0.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Scribbly.Stencil.Generator&version=0.1.0
#tool nuget:?package=Scribbly.Stencil.Generator&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Scribbly Stencil
A framework for organizing and generating minimal API endpoints.
Table of Contents
Example
Below is a brief snip of code to get you started before reading more.
- Add a reference to the
Scribbly.Stencil
package and annotate a method on a partial static class.
[EndpointGroup("/lunch")]
public static partial class LunchGroup
{
// Annotate any method signature with the VerbEndpoint attribute
[GetEndpoint("/{id}", "Get Lunch", "Fetches the current lunch for the provided restaurant ID.")]
private static IResult GetLunchMenu(HttpContext context, string id)
{
return Results.Ok(id);
}
[PostEndpoint("/{id}", "Get Lunch", "Fetches the current lunch for the provided restaurant ID.")]
private static IResult PostLunchMenu(HttpContext context, string id, LunchItem request)
{
return Results.Ok(request);
}
}
Scribbly.Stencil will generate a few things for you behind the Scenes
- An HTTP Endpoint Registration Method
public static IEndpointRouteBuilder MapDinnerGroupPostLunchMenuEndpoint(this IEndpointRouteBuilder builder)
{
builder.MapPost("/{id}", PostLunchMenu);
return builder;
}
- And an Endpoint Registry for All Endpoints Mapping endpoints to Groups
public static IEndpointRouteBuilder MapScribblyEndpoints(this IEndpointRouteBuilder builder)
{
builder.MapLunchGroupGetLunchMenuEndpoint();
builder.MapLunchGroupPostLunchMenuEndpoint();
return builder;
}
- Simply Map Your Application
app.MapScribblyEndpoints();
*Optionally Add a Group or Route Prefix
app.MapScribblyEndpoints("/api");
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.Analyzers (>= 3.3.4)
- Microsoft.CodeAnalysis.CSharp (>= 4.10.0)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 4.10.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.