You can see how to do a template with .Net in Microsoft:Custom Templates
So you could create a template in the same way as:
dotnet new install Microsoft.Azure.WebJobs.ProjectTemplates
So you need to run the next steps: Install this template:
dotnet new install .
If this template is updated, you can use command bellow:
dotnet new update .
To create a project with this template, use:
dotnet new graphql-api -n Product
Install EF
dotnet tool install --global dotnet-ef
This project uses .env variables
DB_NAME=template-cs-staging
DB_HOST=localhost
DB_PORT=5432
DATABASE_USER=user-template
DATABASE_PASSWORD=t3mpl4t3