Arbeidstilsynet.Templates
3.2.1
dotnet new install Arbeidstilsynet.Templates::3.2.1
Dotnet templates
This is a mono repo for dotnet templates, for internal use in Arbeidstilsynet.
The package Arbeidstilsynet.Templates is published to our organization in nuget.org
🏃♂️ Getting Started
Install our template package by running the following command.
dotnet new install Arbeidstilsynet.Templates
Once installed, you can create new templates. We currently support hexarch and common-package.
Hexarch Template
Our opinionated template for all applications which are going to expose an API. By adapting to this template, you will get:
- Well-tested project structure, which derives from the hexagonal architecture pattern
- Observability
- Structured Logging
- Containerized setup, with a local test setup
To create a new project, run:
dotnet new hexarch -n "YourAppName"
Common Package (felles-pakke)
If you want to create a common package, we are providing a template which makes it easy to maintain the package and release new versions. Typical examples for a common package are:
- Client for an external endpoint (e.g. Altinn/Brreg)
- Outsource an infrastructure adapter from your hexagonal application, which can be useful for several hexagonal applications
- Useful extension methods for cross cutting concerns (e.g. Altinn)
Before creating a new package, checkout our package repository dotnet-common and see if there is a similar package available.
If not, you can add a new package by running the following command in the dotnet-common repository:
dotnet new common-package -n "YourPackageName"
🤝 Contribute
This template is intended to be maintained by all developers and should serve as common base for future (or migrated) dotnet projects. Simply propose your changes in a PullRequest.
🚀 Deploy
To publish a new version of the template, create a PR and remember to increase the version number in Arbeidstilsynet.Templates.
To use the latest template version, run:
dotnet new update
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.2.1 | 139 | 4/27/2026 |
| 3.2.0 | 170 | 4/13/2026 |
| 3.1.0 | 153 | 4/13/2026 |
| 3.1.0-alpha.2 | 118 | 3/30/2026 |
| 3.1.0-alpha.1 | 112 | 3/30/2026 |
| 3.0.0 | 182 | 3/11/2026 |
| 3.0.0-alpha | 172 | 3/10/2026 |
| 2.3.7 | 169 | 3/10/2026 |
| 2.3.5 | 195 | 2/20/2026 |
| 2.3.4 | 182 | 2/18/2026 |
| 2.3.4-beta2 | 181 | 2/18/2026 |
| 2.3.4-beta1 | 181 | 2/18/2026 |
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 3.2.1
### Fixed
- fix: remove unncessary `Database.EnsureCreated()` calls
## 3.2.0
### Added
- added(hexarch): TypeScript type generation from OpenAPI specification using openapi-typescript
- added(hexarch): package.json with TypeScript generation scripts
## 3.1.0
### Changed
- changed(deps): update dependencies
## 3.0.0
### Changed
- chore(hexarch): apply new naming strategies (`API.Adapters` --> `App`, `API.Ports` -> `Domain.Ports.App`, `Infrastructure.Ports` -> `Domain.Ports.Infrastructure`, `Infrastructure.Adapters` --> `Infrastructure`)
- chore(hexarch): apply new file structure (see ``README.md``)
- chore(hexarch): use new slnx format
- chore(hexarch): added openapi document transformer to define title and auth options
- changed(deps): update all minor dependencies
## 2.3.5
- added(hexarch): added doc generation to the Domain.Ports.App project
## 2.3.4
- chore: moved package to nuget.org
## 2.3.3
- fixed(hexarch): removed some outdated test snapshots.
## 2.3.2
- fixed(hexarch): corrected sak deadline from ticks to days..
## 2.3.1
- added(hexarch): pin dotnet version in global.json
## 2.3.0
### Changed
- added(hexarch): added more doc strings to the public classes
- added(hexarch): added deadline to the sak (example domain)
- changed(hexarch): fixed typo in Sak.Organisa**s**jonsnummer
## 2.2.5
### Changed
- changed(deps): update all minor dependencies
## 2.2.4
### Changed
- changed(hexarch): updated dockerfile to use latest sdk and updated layers for improved performance (caching)
## 2.2.3
### Changed
- changed(hexarch): clean up test fixtures
## 2.2.2
### Changed
- changed(hexarch): updated readme (dotnet run with default launch profile)
## 2.2.1
### Changed
- changed(deps): update all minor dependencies
## 2.2.0
### Added
- chore(hexarch): Use two distinct health endpoints for readiness and liveness as default (`healthz/ready` and `healthz/live`) instead of just one for all. Also, add a default `StartupHealthCheck` which can be configured to run multiple startup tasks like e.g. a database migration before it will return a healthy state.
## 2.1.1
### Changed
- chore(deps): remove no longer required test dependencies
## 2.1.0
### Changed
- chore(testing): use microsoft testing platform as default test runner
## 2.0.0
### Changed
- chore: Updated dotnet runtime to v10
## 1.6.1
### Changed
- chore(hexarch): Updated to latest feature flag client
## 1.6.0
### Added
- feat(hexarch): Added authentication configuration for entra app registrations
## 1.5.0
### Added
- feat(hexarch): Added feature flag integration to unleash
## 1.4.3
### Changed
- changed(deps): update all minor dependencies
## 1.4.2
### Fixed
- fix(hexarch): update (correct) nuget config within hexarch template to clear package sources before importing the required ones
## 1.4.1
### Added
- feat(hexarch): Added `IDatabaseMigrationService` interface and implementation to handle database migrations
## 1.4.0
### Fixed
- fixed(hexarch): Removed `<IsPublishable>false</IsPublishable>` from all non-test projects
## 1.3.3
### Changed
- changed(hexarch): Updated Arbeidstilsynet.Common.AspNetCore.Extensions to v1.4.2
## 1.3.2
### Changed
- changed(hexarch+common-package): Added project properties to for clarity
## 1.3.1
### Changed
- changed(hexarch+common-package): treat warnings as errors in all projects
## 1.3.0
### Changed
- changed(hexarch): Refactored the unit tests for mapping tests
- chore(hexarch): A bunch of cleanup for consistency and de-cluttering
- added(hexarch): Use otelservice name from config if available
## 1.2.10
### Changed
- chore(hexarch): fixed all the warnings in the hexarch template
## 1.2.9
### Changed
- changed(deps): update all minor dependencies
## 1.2.8
### Added
- added(hexarch): static `Tracer` classes to create custom spans which can be helpful for structuring traces with opentelemetry
## 1.2.7
### Changed
- changed(hexarch): small improvements/bugfixes which occured while using the template for new projects
## 1.2.6
### Changed
- changed(deps): update all minor dependencies
## 1.2.5
### Changed
- changed(hexarch): update nuget config and fix bug in archunit test
## 1.2.4
### Changed
- changed(common-package): Updated ArchUnit tests to allow public abstract classes
## 1.2.3
### Changed
- changed(common-package): Added root namespace to common-package test project
- changed(common-package): Removed duplicate lines from .gitignore
- changed(hexarch): Removed duplicate lines from .gitignore
## 1.2.2
### Changed
- changed(hexarch): Domain section is no longer required in appsettings.json for App
## 1.2.1
### Fixed
- fixed(hexarch): containerlogs when running in docker are now available again (this also makes it possible to see otel logs in grafana again)
## 1.2.0
### Changed
- changed(hexarch): Branched AppSettings into API, Domain and Infrastructure
- changed(hexarch): Renamed `.AddInfrastructureServices(..)` to `.AddInfrastructure(..)`
## 1.1.0
### Added
- hexarch: add support for CORS
### Changed
- hexarch: changed default port for Grafana to 4000 to avoid conflicts
## 1.0.0
Consolidated extensions-package into common-package
### Added
- added(common-package): Added .gitignore
### Changed
- changed(common-package): Single-project structure and new ArchUnit tests. A bit more flexible, which allows publishing any combination of ports/adapters, extensions or just model classes
- changed(hexarch): Updated .gitignore to handle Rider metadata
### Removed
- removed(extension-package): Obsoleted by common-package
## 0.0.11
### Changed
- changed(extension-package): update AT.Common.AspNetCore.Extensions from v0.0.2 to v0.0.3
## 0.0.10
### Changed
- chore(hexarch): Centralize Docker Compose configuration using the include directive and split database and monitoring services into dedicated snippets. Also replaced the monitoring stack in docker compose with a bundled solution.
- chore(hexarch): Use default port 8080 instead of 9008 in dockerized environment.
### Fixed
- fix(common-package): Typo in ArchUnit tests
## 0.0.9
### Fixed
- changed(extension-package): update AT.Common.AspNetCore.Extensions from v0.0.1 to v0.0.2
## 0.0.8
### Changed
- chore(extension-package): Updated the template to use the AT.Common.AspNetCore.Extensions package in order to reduce boilerplate.
## 0.0.7
### Changed
- chore(extension-package): Removed an unnecessary ArchUnit test.
## 0.0.6
### Changed
- chore(hexarch): update swashbuckle from v7 to v8 (major)
## 0.0.5
### Changed
- chore(hexarch): update scalar from v1 to v2 (major)
## 0.0.4
### Changed
- chore: Dependency update (all non minor)
## 0.0.3
### Changed
- extension-package: Updated template ReadMe
## 0.0.2
### Changed
- CI/CD: fix automatic github release when succesfully published.
## 0.0.1
### Added
- Single template project which contains all templates which are available today (`hexarch`,`common-package`,`extensions-package`).
- CI/CD: Workflow which supports building and publishing new versions of this project.
### Changed
- Moved existing templates from azure devops to this repository. Tagged the legacy repositories with a deprecation remark.