.NET 8 REST API DB Template
This Visual Studio solution template is the result of the evolution of many other templates. It includes the solution to many problems faced in real-life projects as well as the will to follow a certain level of good practices.
The "Why" of this extension is to cover the need of business-oriented templates. IDEs come with full of technical templates. However, I thought it could be valuable to create value with deeper approaches and help developers daily work.
The adopted architecture is not a full and strict Domain Driven solution to avoid a too extreme position and extend the usability of the template. However, it follows a business (or domain) oriented approach.
Choices are based on experiences that might be biased and as a result, the template might have an opinionated perspective. Feel free to provide feedback and use the template at will.
This template creates a Visual Studio solution with many projects answering to the problems below:
One could wonder why such a template could still be relevant in the minimalistic era we are living (Minimal APIs trend, etc).
REST "Business" APIS?
The initial and natural use of such a template would be for complex and rich REST APIs. RESTFul APIs are not meant to contain business logic because of their nature and inherent definition (resource-oriented, not business logic-oriented). We have been living a trend where "everything" was meant to be rest (even business APIs). Even though it has started to change, it remains quite common to develop such APIs.
With this in mind, IDEs or frameworks do not usually include such templates.
"Simple" APIs vs Complex APIs
Rich and business APIs might start "simple" but, quite soon, they grow and end up needing some structure and segregation of concerns. This template anticipates that and, even though it might seem a bit overkilling for an initial and simple API, it will help developers to keep their code clean and structured.
Additional details can be found here. .NET 8 version will be updated soon.
In addition to this Visual Studio version, you can find here the .NET CLI version.