KakarooNLayer Template Web API
This project is an example of streaming DDD architecture with popular market standards using T4 templates.
Access the base repository and several examples of how to make it easy to build fast and robust Web APIs.
Installation and Configuration
Download and install the vsix package through the browser or visual studio (Tools > Extensions and Updates > Online search KakarooNLayer > Download).
Install Visual Studio 2017 https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/02-InstallFromVS.PNG
Go to Tools> Extensions and Updates and make sure it's already available https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/03-CheckInstallComplete.png
Go to File > New > Project and select the "KakarooNLayer ..." template in the Web category. https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/04-NewProject.png
You will see a solution with several projects following the DDD approach. https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/05-StructureProject.png
You will need to restore the project references. Right-click on the solution and "Restore NuGet Packages". https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/06-RestoreNugetPackage.png
Great. Let's set up our application to generate our models from a SQL SERVER database. The configuration file has the name of your project with an Entity suffix of type JSON and is in the projects root folder.
Right click on the solution and go to "Open Folder in File Explorer". https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/07-OpenContainerFolder.png
Access the project folder with the same name as your solution. https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/08-AccessFolderConfig.png
Open the JSON configuration file. https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/09-OpenFileConfig.png
Provide the configuration to access your SQL SERVER database. https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/10-EditConfigFile.png
The first time we run the settings of our project we should leave the configuration file with the "generate = true" attribute. After the first run the file will be overwritten with the entire database table structure. https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/11-ConfigFileProcessed.png
Go to the Build menu> Transform All T4 Templates https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/12-TransformAllTemplates.png
Note: This process of generating all the templates you can run once again for security. ;)
Right click on the project "WebApi" and "Set as StartUp Project". https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/13-SetStartupProject.png
Right-click on the solution and "Rebuild Solution". https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/14-RebuildSolution.png
Access the Web.Config that is in the WebApi project and modify the "DatabaseContext" connection string to the same address as the configuration file. https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/15-ConfigurationDatabaseWebApi.png
Let's run our application (F5). https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/16-Ready.png
Ufa! Now it's just joy!
Access the API menu to check the detailed description of your API requests. https://github.com/kallebelins/KakarooNLayer/blob/master/media/install/17-HelpAPI.png