This repository contains dotnet new templates for ImmediatePlatform handlers and projects.
Clone this repository and run dotnet new install ./src/Immediate.Templates/.
A project template for creating a RESTful Web API using ImmediatePlatform handlers. Scaffolds a minimal ASP.NET Core project pre-configured with OpenAPI, Immediate.Handlers, Immediate.Apis, and Immediate.Validations.
Short name: webapiip
Type: Project
Language: C#
dotnet new webapiip -n MyApi| Option | Alias | Description | Type | Default |
|---|---|---|---|---|
--cpm |
-c |
Use CPM style PackageReferences (omits version number) |
bool |
false |
An item template for creating an Immediate.Handlers handler. Generates a handler class with configurable query/response records, optional Immediate.Apis API endpoint mapping, Immediate.Validations support, and endpoint customization.
Short name: iphandler
Type: Item
Language: C#
dotnet new iphandler -n GetWeather| Option | Alias | Description | Type | Default |
|---|---|---|---|---|
--namespace |
-ns |
The root namespace for the generated handler. | string |
MyNamespace |
--query-class-name |
-q |
The name of the query class the handler will receive. | string |
Query |
--response-class-name |
-r |
The name of the response class the handler will return. | string |
Response |
--http-method |
-m |
Adds the associated attribute to register the handler as an API endpoint. Choices: Get, Post, Put, Delete. | choice |
(none) |
--validations |
-v |
Generates a handler query implementing Immediate.Validations. | bool |
false |
--customize-endpoint |
-c |
Generates a CustomizeEndpoint method in the handler. Requires an HTTP method to be specified. |
bool |
false |
Create a handler with a GET endpoint and validations:
dotnet new iphandler -n GetWeather -m Get -p:v -q Query -r WeatherForecastsAn item template for creating an Immediate.Cache cache. Generates a cache and associated handler class.
Short name: ipcache
Type: Item
Language: C#
dotnet new ipcache -n GetWeather| Option | Alias | Description | Type | Default |
|---|---|---|---|---|
--namespace |
-ns |
The root namespace for the generated handler. | string |
MyNamespace |