Copy a starting point that matches the workload.

Install the template once with dotnet new install ./template/content. Replace the project name, copy a command, then inspect the generated application.

GitHub repository

Minimal API without persistence

Use for a focused endpoint surface that does not own durable data or require caller identity.

dotnet new dotnet-service -n PublicApi --api-styleminimal--data-providernone--database-providernone--authenticationnone--authorizationnone

Controllers + PostgreSQL

Use when the service owns relational data and conventional controller routing fits the API.

dotnet new dotnet-service -n OrderService --api-stylecontrollers--data-providerefcore--database-providerpostgresql

Controllers + SQL Server

Use when the service owns relational data in an environment standardized on SQL Server.

dotnet new dotnet-service -n CustomerService --api-stylecontrollers--data-providerefcore--database-providersqlserver

Minimal API + SQLite

Use for a small service or local deployment that needs owned relational state without an external database server.

dotnet new dotnet-service -n CatalogService --api-styleminimal--data-providerefcore--database-providersqlite

Hosted service without a business API

Use for scheduled or continuous work. Health endpoints remain available for operation.

dotnet new dotnet-service -n ReconciliationWorker --api-stylenone--job-processinghosted-service--data-providernone--database-providernone

HTTP integration + OpenTelemetry

Use when the service calls another HTTP service and needs distributed traces across the request path.

dotnet new dotnet-service -n PricingService --integrationhttp--observabilityopentelemetry--data-providernone--database-providernone