├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ └── build.yml ├── .gitignore ├── Generator.sln ├── azure-pipelines.yml.excllude ├── deploy ├── README.md └── azure-guide.md ├── docs ├── .nojekyll ├── README.md ├── img │ ├── Step1.png │ ├── Step2.png │ ├── Step3.png │ ├── Step4.png │ ├── Step5.png │ ├── Step6.png │ ├── hexagonal-arch.drawio │ ├── hexagonal-arch.png │ ├── logo.drawio │ └── logo.png └── index.html └── src ├── .template.config ├── template.json └── template.vstemplate ├── Generator.Domain.UnitTest ├── DealDomainTest.cs └── Generator.Domain.UnitTest.csproj ├── Generator.Domain ├── DealDomain.cs ├── DomainExtension.cs └── Generator.Domain.csproj ├── Generator.DomainApi.UnitTest ├── Generator.DomainApi.UnitTest.csproj └── Model │ ├── DealInfoTest.cs │ └── DealTest.cs ├── Generator.DomainApi ├── BaseEntity.cs ├── Generator.DomainApi.csproj ├── Model │ ├── Deal.cs │ └── DealInfo.cs ├── Port │ ├── IObtainDeal.cs │ └── IRequestDeal.cs └── Services │ ├── AppSettings.cs │ └── ApplicationDetail.cs ├── Generator.Persistence.Adapter.UnitTest ├── Common │ └── ApplicationDbContextFactory.cs ├── Context │ └── ApplicationDbContextTest.cs └── Generator.Persistence.Adapter.UnitTest.csproj ├── Generator.Persistence.Adapter ├── Context │ └── ApplicationDbContext.cs ├── Generator.Persistence.Adapter.csproj └── PersistenceExtensions.cs ├── Generator.RestAdapter.UnitTest ├── Controllers │ └── DealControllerTest.cs └── Generator.RestAdapter.UnitTest.csproj ├── Generator.RestAdapter ├── Controllers │ └── v1 │ │ └── DealController.cs └── Generator.RestAdapter.csproj ├── Generator ├── Controllers │ └── MetaController.cs ├── Extension │ ├── ConfigureContainer.cs │ └── ConfigureServiceContainer.cs ├── Generator.csproj ├── Program.cs ├── Properties │ └── launchSettings.json ├── Startup.cs ├── appsettings.Development.json └── appsettings.json ├── HexaVSIX.sln └── Template ├── Hexagonal-arch-logo.png ├── LICENSE.txt ├── Properties ├── AssemblyInfo.cs ├── project-icon.png └── wafflebuilder.targets ├── Resources └── Hexagonal-arch-logo.png ├── Template.csproj ├── index.html ├── logo.jpg ├── source.extension.vsixmanifest ├── stylesheet.css ├── template.pkgdef └── template └── templatepack.Template.proj /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **Additional context** 24 | Add any other context about the problem here. 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "[FEATURE]" 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | types: [opened, synchronize, reopened] 8 | jobs: 9 | build: 10 | name: Build 11 | runs-on: windows-latest 12 | steps: 13 | - name: Set up JDK 11 14 | uses: actions/setup-java@v1 15 | with: 16 | java-version: 1.11 17 | - uses: actions/checkout@v2 18 | with: 19 | fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis 20 | - name: Cache SonarCloud packages 21 | uses: actions/cache@v1 22 | with: 23 | path: ~\sonar\cache 24 | key: ${{ runner.os }}-sonar 25 | restore-keys: ${{ runner.os }}-sonar 26 | - name: Cache SonarCloud scanner 27 | id: cache-sonar-scanner 28 | uses: actions/cache@v1 29 | with: 30 | path: .\.sonar\scanner 31 | key: ${{ runner.os }}-sonar-scanner 32 | restore-keys: ${{ runner.os }}-sonar-scanner 33 | - name: Install SonarCloud scanner 34 | if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' 35 | shell: powershell 36 | run: | 37 | New-Item -Path .\.sonar\scanner -ItemType Directory 38 | dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner 39 | - name: Build and analyze 40 | env: 41 | GITHUB_TOKEN: ${{ secrets.GIT_TOKEN_HA }} # Needed to get PR information, if any 42 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} 43 | shell: powershell 44 | run: | 45 | .\.sonar\scanner\dotnet-sonarscanner begin /k:"Amitpnk_Hexagonal-Arch-ASP.NET-Core" /o:"amitpnk" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" 46 | dotnet build Generator.sln 47 | .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | 352 | .sonarqube 353 | -------------------------------------------------------------------------------- /Generator.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30717.126 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator", "src\Generator\Generator.csproj", "{1669E311-49AC-44E7-B3FC-7CC3C26662F0}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator.DomainApi", "src\Generator.DomainApi\Generator.DomainApi.csproj", "{10AAF466-3F4A-47E0-9E75-9737B19B46AF}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator.Domain", "src\Generator.Domain\Generator.Domain.csproj", "{C2D44FE4-410D-408C-8435-CCCB77C4339E}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator.Persistence.Adapter", "src\Generator.Persistence.Adapter\Generator.Persistence.Adapter.csproj", "{8291FB65-54AF-4D64-AE68-B4F64E33DBE1}" 13 | EndProject 14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator.RestAdapter", "src\Generator.RestAdapter\Generator.RestAdapter.csproj", "{AD28F426-0678-452C-9D95-CB14703D8756}" 15 | EndProject 16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator.Domain.UnitTest", "src\Generator.Domain.UnitTest\Generator.Domain.UnitTest.csproj", "{4BED05BB-3B4A-4D25-82F6-37EFA7587314}" 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator.DomainApi.UnitTest", "src\Generator.DomainApi.UnitTest\Generator.DomainApi.UnitTest.csproj", "{F5058CEB-EFF0-439B-A230-480A702CEEAC}" 19 | EndProject 20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator.Persistence.Adapter.UnitTest", "src\Generator.Persistence.Adapter.UnitTest\Generator.Persistence.Adapter.UnitTest.csproj", "{DF38D154-5A4E-461F-BA72-C47BE6C4405A}" 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator.RestAdapter.UnitTest", "src\Generator.RestAdapter.UnitTest\Generator.RestAdapter.UnitTest.csproj", "{AB8835EF-ED5D-4F0B-A0D9-99F0359BEFC6}" 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|Any CPU = Debug|Any CPU 27 | Release|Any CPU = Release|Any CPU 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {1669E311-49AC-44E7-B3FC-7CC3C26662F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {1669E311-49AC-44E7-B3FC-7CC3C26662F0}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {1669E311-49AC-44E7-B3FC-7CC3C26662F0}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {1669E311-49AC-44E7-B3FC-7CC3C26662F0}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {10AAF466-3F4A-47E0-9E75-9737B19B46AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {10AAF466-3F4A-47E0-9E75-9737B19B46AF}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {10AAF466-3F4A-47E0-9E75-9737B19B46AF}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {10AAF466-3F4A-47E0-9E75-9737B19B46AF}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {C2D44FE4-410D-408C-8435-CCCB77C4339E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {C2D44FE4-410D-408C-8435-CCCB77C4339E}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {C2D44FE4-410D-408C-8435-CCCB77C4339E}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {C2D44FE4-410D-408C-8435-CCCB77C4339E}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {8291FB65-54AF-4D64-AE68-B4F64E33DBE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {8291FB65-54AF-4D64-AE68-B4F64E33DBE1}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {8291FB65-54AF-4D64-AE68-B4F64E33DBE1}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {8291FB65-54AF-4D64-AE68-B4F64E33DBE1}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {AD28F426-0678-452C-9D95-CB14703D8756}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 47 | {AD28F426-0678-452C-9D95-CB14703D8756}.Debug|Any CPU.Build.0 = Debug|Any CPU 48 | {AD28F426-0678-452C-9D95-CB14703D8756}.Release|Any CPU.ActiveCfg = Release|Any CPU 49 | {AD28F426-0678-452C-9D95-CB14703D8756}.Release|Any CPU.Build.0 = Release|Any CPU 50 | {FA557DAF-FEF3-4225-A467-53B63E6EEC8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 51 | {FA557DAF-FEF3-4225-A467-53B63E6EEC8F}.Debug|Any CPU.Build.0 = Debug|Any CPU 52 | {FA557DAF-FEF3-4225-A467-53B63E6EEC8F}.Release|Any CPU.ActiveCfg = Release|Any CPU 53 | {FA557DAF-FEF3-4225-A467-53B63E6EEC8F}.Release|Any CPU.Build.0 = Release|Any CPU 54 | {4BED05BB-3B4A-4D25-82F6-37EFA7587314}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 55 | {4BED05BB-3B4A-4D25-82F6-37EFA7587314}.Debug|Any CPU.Build.0 = Debug|Any CPU 56 | {4BED05BB-3B4A-4D25-82F6-37EFA7587314}.Release|Any CPU.ActiveCfg = Release|Any CPU 57 | {4BED05BB-3B4A-4D25-82F6-37EFA7587314}.Release|Any CPU.Build.0 = Release|Any CPU 58 | {F5058CEB-EFF0-439B-A230-480A702CEEAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 59 | {F5058CEB-EFF0-439B-A230-480A702CEEAC}.Debug|Any CPU.Build.0 = Debug|Any CPU 60 | {F5058CEB-EFF0-439B-A230-480A702CEEAC}.Release|Any CPU.ActiveCfg = Release|Any CPU 61 | {F5058CEB-EFF0-439B-A230-480A702CEEAC}.Release|Any CPU.Build.0 = Release|Any CPU 62 | {DF38D154-5A4E-461F-BA72-C47BE6C4405A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 63 | {DF38D154-5A4E-461F-BA72-C47BE6C4405A}.Debug|Any CPU.Build.0 = Debug|Any CPU 64 | {DF38D154-5A4E-461F-BA72-C47BE6C4405A}.Release|Any CPU.ActiveCfg = Release|Any CPU 65 | {DF38D154-5A4E-461F-BA72-C47BE6C4405A}.Release|Any CPU.Build.0 = Release|Any CPU 66 | {AB8835EF-ED5D-4F0B-A0D9-99F0359BEFC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 67 | {AB8835EF-ED5D-4F0B-A0D9-99F0359BEFC6}.Debug|Any CPU.Build.0 = Debug|Any CPU 68 | {AB8835EF-ED5D-4F0B-A0D9-99F0359BEFC6}.Release|Any CPU.ActiveCfg = Release|Any CPU 69 | {AB8835EF-ED5D-4F0B-A0D9-99F0359BEFC6}.Release|Any CPU.Build.0 = Release|Any CPU 70 | EndGlobalSection 71 | GlobalSection(SolutionProperties) = preSolution 72 | HideSolutionNode = FALSE 73 | EndGlobalSection 74 | GlobalSection(ExtensibilityGlobals) = postSolution 75 | SolutionGuid = {3BBF5BAC-DFC4-4FF9-B4C2-DD935FC10F1A} 76 | EndGlobalSection 77 | EndGlobal 78 | -------------------------------------------------------------------------------- /azure-pipelines.yml.excllude: -------------------------------------------------------------------------------- 1 | # ASP.NET Core (.NET Framework) 2 | # Build and test ASP.NET Core projects targeting the full .NET Framework. 3 | # Add steps that publish symbols, save build artifacts, and more: 4 | # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core 5 | 6 | trigger: 7 | - main 8 | 9 | pool: 10 | vmImage: 'windows-latest' 11 | 12 | variables: 13 | solution: 'Generator.sln' 14 | buildPlatform: 'Any CPU' 15 | buildConfiguration: 'Release' 16 | 17 | steps: 18 | - task: NuGetToolInstaller@1 19 | 20 | - task: NuGetCommand@2 21 | inputs: 22 | restoreSolution: '$(solution)' 23 | 24 | - task: VSBuild@1 25 | inputs: 26 | solution: '$(solution)' 27 | msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"' 28 | platform: '$(buildPlatform)' 29 | configuration: '$(buildConfiguration)' 30 | 31 | - task: VSTest@2 32 | inputs: 33 | platform: '$(buildPlatform)' 34 | configuration: '$(buildConfiguration)' 35 | -------------------------------------------------------------------------------- /deploy/README.md: -------------------------------------------------------------------------------- 1 | ### Login Azure 2 | ``` 3 | az login 4 | ``` 5 | 6 | ### Group exist 7 | 8 | ``` 9 | az group exists -n HexagonalArch_Dev 10 | ``` 11 | 12 | ### Create Resource Group 13 | 14 | ``` 15 | az group create --name "HexagonalArch_Dev" 16 | --location "southindia" 17 | --tags "Environment=Development" 18 | "Project=HexagonalArch" "Department=SD" "ResourceType=Mixed" 19 | ``` 20 | 21 | ### Create App Service Plan 22 | 23 | ``` 24 | az appservice plan create --resource-group "HexagonalArch_Dev" \ 25 | --name HexagonalArch-Hosts \ 26 | --location "southindia" \ 27 | --sku F1 \ 28 | --tags "Environment=Development" "Project=HexagonalArch" "Department=SD" 29 | ``` 30 | 31 | ### Create App Services: 32 | 33 | ``` 34 | az webapp create --resource-group "HexagonalArch_Dev" --plan HexagonalArch-Hosts --name webapi-hexagonalarch --runtime "DOTNET:5.0" --tags "Environment=Development" "Project=HexagonalArch" "Department=SD" 35 | ``` 36 | 37 | ### Create Lock: 38 | ``` 39 | az lock create --lock-type CanNotDelete \ 40 | --name CanNotDelete \ 41 | --resource-group HexagonalArch_Dev 42 | ``` 43 | 44 | ### Clean Up 45 | 46 | ``` 47 | az lock delete --name CanNotDelete --resource-group HexagonalArch_Dev 48 | az group delete --name "HexagonalArch_Dev" --yes 49 | ``` 50 | -------------------------------------------------------------------------------- /deploy/azure-guide.md: -------------------------------------------------------------------------------- 1 | # Azure guilde 2 | 3 | ## Azure location 4 | 5 | ``` 6 | az account list-locations 7 | ``` 8 | 9 | ## Azure list of runtimes 10 | 11 | ``` 12 | az webapp list-runtimes 13 | az webapp list-runtimes --linux 14 | ``` 15 | 16 | 17 | 18 | 19 | 20 | 21 | | DisplayName | Latitude | Longitude | Name 22 | | --- |--- |--- |--- 23 | | East Asia | 22.267 | 114.188 | eastasia 24 | | Southeast Asia | 1.283 | 103.833 | southeastasia 25 | | Central US | 41.5908 | -93.6208 | centralus 26 | | East US | 37.3719 | -79.8164 | eastus 27 | | East US 2 | 36.6681 | -78.3889 | eastus2 28 | | West US | 37.783 | -122.417 | westus 29 | | North Central US | 41.8819 | -87.6278 | northcentralus 30 | | South Central US | 29.4167 | -98.5 | southcentralus 31 | | North Europe | 53.3478 | -6.2597 | northeurope 32 | | West Europe | 52.3667 | 4.9 | westeurope 33 | | Japan West | 34.6939 | 135.5022 | japanwest 34 | | Japan East | 35.68 | 139.77 | japaneast 35 | | Brazil South | -23.55 | -46.633 | brazilsouth 36 | | Australia East | -33.86 | 151.2094 | australiaeast 37 | | Australia Southeast | -37.8136 | 144.9631 | australiasoutheast 38 | | South India | 12.9822 | 80.1636 | southindia 39 | | Central India | 18.5822 | 73.9197 | centralindia 40 | | West India | 19.088 | 72.868 | westindia 41 | | Canada Central | 43.653 | -79.383 | canadacentral 42 | | Canada East | 46.817 | -71.217 | canadaeast 43 | | UK South | 50.941 | -0.799 | uksouth 44 | | UK West | 53.427 | -3.084 | ukwest 45 | | West Central US | 40.890 | -110.234 | westcentralus 46 | | West US 2 | 47.233 | -119.852 | westus2 47 | | Korea Central | 37.5665 | 126.9780 | koreacentral 48 | | Korea South | 35.1796 | 129.0756 | koreasouth 49 | | France Central | 46.3772 | 2.3730 | francecentral 50 | | France South | 43.8345 | 2.1972 | francesouth 51 | | Australia Central | -35.3075 | 149.1244 | australiacentral 52 | | Australia Central 2 | -35.3075 | 149.1244 | australiacentral2 53 | | South Africa North | -25.731340 | 28.218370 | southafricanorth 54 | | South Africa West | -34.075691 | 18.843266 | southafricawest 55 | 56 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/61c16728842679c7d768723685c4046d158bb78c/docs/.nojekyll -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | [![Visual Studio Marketplace version](https://img.shields.io/badge/-HexagonalArchitecture-%23e2165e.svg)](https://marketplace.visualstudio.com/items?itemName=AmitNaik.HexagonalArchitecture) 2 | [![Visual Studio Marketplace downloads](https://vsmarketplacebadge.apphb.com/installs/AmitNaik.HexagonalArchitecture.svg)](https://marketplace.visualstudio.com/items?itemName=AmitNaik.HexagonalArchitecture) 3 | [![Visual Studio Marketplace ratings](https://vsmarketplacebadge.apphb.com/rating/AmitNaik.HexagonalArchitecture.svg)](https://marketplace.visualstudio.com/items?itemName=AmitNaik.HexagonalArchitecture) 4 | [![Visual Studio Marketplace version](https://vsmarketplacebadge.apphb.com/version/AmitNaik.HexagonalArchitecture.svg)](https://marketplace.visualstudio.com/items?itemName=AmitNaik.HexagonalArchitecture) 5 | 6 | ---- 7 | [![Build](https://github.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/actions/workflows/build.yml/badge.svg)](https://github.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/actions/workflows/build.yml) 8 | [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Amitpnk_Hexagonal-Arch-ASP.NET-Core&metric=bugs)](https://sonarcloud.io/dashboard?id=Amitpnk_Hexagonal-Arch-ASP.NET-Core) 9 | [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=Amitpnk_Hexagonal-Arch-ASP.NET-Core&metric=code_smells)](https://sonarcloud.io/dashboard?id=Amitpnk_Hexagonal-Arch-ASP.NET-Core) 10 | [![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=Amitpnk_Hexagonal-Arch-ASP.NET-Core&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=Amitpnk_Hexagonal-Arch-ASP.NET-Core) 11 | [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=Amitpnk_Hexagonal-Arch-ASP.NET-Core&metric=ncloc)](https://sonarcloud.io/dashboard?id=Amitpnk_Hexagonal-Arch-ASP.NET-Core) 12 | [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Amitpnk_Hexagonal-Arch-ASP.NET-Core&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=Amitpnk_Hexagonal-Arch-ASP.NET-Core) 13 | [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Amitpnk_Hexagonal-Arch-ASP.NET-Core&metric=alert_status)](https://sonarcloud.io/dashboard?id=Amitpnk_Hexagonal-Arch-ASP.NET-Core) 14 | [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Amitpnk_Hexagonal-Arch-ASP.NET-Core&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=Amitpnk_Hexagonal-Arch-ASP.NET-Core) 15 | [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=Amitpnk_Hexagonal-Arch-ASP.NET-Core&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=Amitpnk_Hexagonal-Arch-ASP.NET-Core) 16 | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/blob/develop/LICENSE) 17 | 18 | # Hexagonal Architecture ASP.NET Core 19 | 20 |
21 |

22 | 23 | Logo 24 | 25 | 26 |

Hexagonal Architecture ASP.NET Core

27 | 28 |

29 | App generator API solution template which is built on Hexagnonal Architecture with all essential feature using .NET Core! 30 |
31 | Explore the docs » 32 |
33 |
34 | View Demo 35 | · 36 | Report Bug 37 | · 38 | Request Feature 39 |

40 |

41 | 42 |
43 | Table of Contents 44 |
    45 |
  1. 46 | About The Project 47 | 50 |
  2. 51 |
  3. 52 | Getting Started 53 | 57 |
  4. 58 |
  5. Usage
  6. 59 |
  7. Roadmap
  8. 60 |
  9. Contributing
  10. 61 |
  11. License
  12. 62 |
  13. Contact
  14. 63 |
  15. Acknowledgements
  16. 64 |
65 |
66 | 67 | ## Give a Star! :star: 68 | If you like or are using this project to learn or start your solution, please give it a star. Thanks! 69 | 70 | ## Support This Project 71 | 72 | If you have found this project helpful, either as a library that you use or as a learning tool, please consider buying me a coffee: 73 | 74 | Buy Me A Coffee 75 | 76 | 77 | ## Hexagonal Architecture 78 | 79 | Hexagonal architecture was proposed by Alistair Cockburn in 2005. 80 | 81 | Hexagonal Architecture, or to call it properly, "Ports and Adapters pattern", is driven by the idea that the application is central to your system. All inputs and outputs reach or leave the core of the application through a port that isolates the application from external technologies, tools and delivery mechanics 82 | 83 | ## About The Project 84 | 85 | App generator API solution template which is built on Hexagnonal Architecture with all essential feature using .NET Core! 86 | 87 | ![image](img/hexagonal-arch.png) 88 | 89 | ## Getting Started 90 | 91 | ### Step 1: Download extension from project template 92 | 93 |

Download from Marketplace

94 | 95 | ![image](img/Step1.png) 96 | 97 | ### Step 2: Create Project 98 | 99 | Select project type as WebAPI, and select Hexagonal Architecture 100 | 101 | ![image](img/Step2.png) 102 | 103 | ### Step 3: Select Hexagonal Architecture project template 104 | 105 | Select project type as Web API, and select Hexagonal Architecture 106 | 107 | ![image](img/Step3.png) 108 | 109 | ### Step 4: Project is ready 110 | 111 | ![image](img/Step4.png) 112 | 113 | ### Step 5: Build and run application 114 | 115 | #### Health check UI 116 | 117 | Navigate to Health Checks UI https://localhost:44377/healthcheck-ui and make sure everything is green. 118 | 119 | ** Change port number according to your application 120 | 121 | ![image](img/Step6.png) 122 | 123 | #### Swagger UI 124 | 125 | Swagger UI https://localhost:44377/OpenAPI/index.html 126 | 127 | ** Change port number according to your application 128 | 129 | ![image](img/Step5.png) 130 | 131 | ## Contributing 132 | 133 | Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**. 134 | 135 | 1. Fork the Project 136 | 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) 137 | 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
138 | Note: while commiting message follow [conventional standard](https://www.conventionalcommits.org/en/v1.0.0/) 139 | 4. Push to the Branch (`git push origin feature/AmazingFeature`) 140 | 5. Open a Pull Request 141 | 142 | ## Project description 143 | 144 | we can see that all the Layers are dependent only on the Core Layers 145 | 146 |
147 | Domain Api layer 148 |

149 | Domain Api Layers (Core layer) is implemented in center and never depends on any other layer.
150 | It is contract for domain layer interaction(ports) so that primary and secondary adapters can implement the contract.This is also known and DIP or Dependency Inversion Principle 151 |

152 |
153 |
154 | Domain layer 155 |

156 | Domain Layers (Business layer) which has business logic. and it is keep clean with no other dependencies. 157 |

158 |
159 |
160 | Rest Adapter layer 161 |

162 | Rest Adapter also known as left port's adapter and primary adapter where we implement restfull service (i.e., GET, POST, PUT, DELETE, etc) 163 |

164 |
165 |
166 | Persistence Adapter layer 167 |

168 | Rest Adapter also known as right port's adapter and secondary adapterwhere we have implement Entityframework core which already implements a repository design pattern. DbContext will be UoW (Unit of Work) and each DbSet is the repository. This interacts with our database using dataproviders 169 |

170 |
171 |
172 | Bootstrap/Presentation Layer 173 |

174 | This is final build of project, where it all begins 175 |

176 |
177 | 178 | ## Licence Used 179 | 180 | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/blob/develop/LICENSE) 181 | 182 | See the contents of the LICENSE file for details 183 | 184 | ## Contact 185 | 186 | Having any issues or troubles getting started? Drop a mail to amit.naik8103@gmail.com or [Raise a Bug or Feature Request](https://github.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/issues/new). Always happy to help. 187 | 188 | ## Acknowledgements 189 | 190 | * [Article 1 - Hexagonal Architecture](https://dzone.com/articles/hexagonal-architecture-what-is-it-and-how-does-it) 191 | * [Article 2 - Difference between Hexa and Microservice](https://stackoverflow.com/questions/54697026/hexagonal-architecture-and-microservices-how-do-they-fit-together) 192 | * [Article 3 - Microservices Hexagonal Architecture](https://medium.com/sciforce/another-story-about-microservices-hexagonal-architecture-23db93fa52a2) 193 | * [Article 4 - Netflix - Hexagonal article](https://netflixtechblog.com/ready-for-changes-with-hexagonal-architecture-b315ec967749) -------------------------------------------------------------------------------- /docs/img/Step1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/61c16728842679c7d768723685c4046d158bb78c/docs/img/Step1.png -------------------------------------------------------------------------------- /docs/img/Step2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/61c16728842679c7d768723685c4046d158bb78c/docs/img/Step2.png -------------------------------------------------------------------------------- /docs/img/Step3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/61c16728842679c7d768723685c4046d158bb78c/docs/img/Step3.png -------------------------------------------------------------------------------- /docs/img/Step4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/61c16728842679c7d768723685c4046d158bb78c/docs/img/Step4.png -------------------------------------------------------------------------------- /docs/img/Step5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/61c16728842679c7d768723685c4046d158bb78c/docs/img/Step5.png -------------------------------------------------------------------------------- /docs/img/Step6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/61c16728842679c7d768723685c4046d158bb78c/docs/img/Step6.png -------------------------------------------------------------------------------- /docs/img/hexagonal-arch.drawio: -------------------------------------------------------------------------------- 1 | 7Vxpd5tIl/41/bF92JeP7CAJxCIE0pc5iH1H7OjXT+HYiRcl7e52MnlnRvFxoChRxV2e+9yqa/5AuXKWWq9J1DoIiz8QKJj/QPk/EITCEfB7bVi+NGA09qUhbtPgSxP8rcFKb+FTI/TUOqRB2L3q2Nd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JnKtQ2Zu0YPI1ufE9iucsQv2mpfQKqxxw1c8uXa/LMB3WKJqaugqSXNRXG44R+UyjW7CPQo63GgXWZcxWDVbOsVYFy/ZjWnjQptv4jheF1XXn09ZnYberE7Dd9b87+0o0w849u9Xp3m+QkR87LYHecYFJ9B0c/v83p8fLU4/1rSFrTCGa2nb02bad/dP/s6O2+OODC5i7POK9oul7nfbb99dC/9gvUE99OvWJvf1lV33dnvGMPRK5KH1yk/a6MHhryVRzyV/0PtKNJR6eK4P++ySj+rPY4jxtwHSxvB2AhR/u23vaN0M1+JtiPlPKEVD8DfFGXdq+37WFs9dcX7olUq/+u+NXlcD//HL/97oZW3vj4zwp//hNwo/wDAEEzSNoSRGE69tB1pfb0BSOIIDnEUw8s3u6kdfb4Bi1AMGwQgBXJ7CSOjtMBj9QJMkRYApgC40/LG3gv2Dit4//yvBVTtoXRzWBuj4ZxgfL3eqQvQ2Lb1H8X51+aeikPZbTQWgUdAujNbHbID5/vH9UtXXfzH5FxjxEhKQO1U8+Prv3vY98fh5usOL9i+fr8b4Dknu2OeHKzNx4j24wPfeekJ8QsHFXeW9B2sr9Osq+JD6zMcJ/h/S39vC75+pv3UV4eubNL/46rfXkaLCfwM= -------------------------------------------------------------------------------- /docs/img/hexagonal-arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/61c16728842679c7d768723685c4046d158bb78c/docs/img/hexagonal-arch.png -------------------------------------------------------------------------------- /docs/img/logo.drawio: -------------------------------------------------------------------------------- 1 | 7ZXfT4MwEMf/Gh5dKKXKHh3qNNG4ZP6IT6aDDhoLh1114F9vO9oBQxN9NDFpSO9z1+N6/RY8HBf1XNIqv4GUCS/w09rDZ14QRCTQTwOaFoTTsAWZ5GmLUAeW/INZ6Fv6xlO2GQQqAKF4NYQJlCVL1IBRKWE7DFuDGL61ohkbgWVCxZg+8lTlblt+xy8Zz3L3ZuRbT0FdsAWbnKaw7SF87uFYAqh2VtQxE6Z3ri/tuotvvPvCJCvVTxbcL8KnfPF8i+YPd1fHy5vXJlsc4TbLOxVvdsO2WNW4DrwzqbhuyDVdMbGADVccSu1agVJQeHjmAk4Fz4xDQaVprgqhDaSneueVSVbUmdHIZEU3PJlUIJrMZJqZWQwg091ZkZke/iQgXhD7HtElxDtwMgTIWBPSC5hOWxQcLkI9EByA0ZIurR5tbYKXpnxfm2suRAwC5K43eB0lLEnMFpWEF9bzrCISEn/vcdoJNRkfnD1L00hW95A9yDmDginZ6BDrxcdWVPZWIWdvO42iyLK8r0+nRmrvRbbP3UlHT6x6fqGk8F9Jf1JJUzJUUkTGSkJfKOnk90LSZve52/l6/wx8/gk= -------------------------------------------------------------------------------- /docs/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/61c16728842679c7d768723685c4046d158bb78c/docs/img/logo.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Document 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Amit Naik", 3 | "classifications": [], 4 | "description": "Hexagonal Architecture Web API solution template which is built on Domain-Driven Design (DDD)-based using .NET Core", 5 | "name": "Hexagonal Architecture", 6 | "defaultName": "HA", 7 | "identity": "HexaArchitecture.CSharp", 8 | "groupIdentity": "HexaArchitecture", 9 | "tags": { 10 | "language": "C#", 11 | "type": "project" 12 | }, 13 | "shortName": "HexaArchitecture", 14 | "sourceName": "Generator", 15 | "guids": [], 16 | "primaryOutputs": [ 17 | { 18 | "path": "Generator\\Generator.csproj" 19 | }, 20 | { 21 | "path": "Generator.Domain\\Generator.Domain.csproj" 22 | }, 23 | { 24 | "path": "Generator.DomainApi\\Generator.DomainApi.csproj" 25 | }, 26 | { 27 | "path": "Generator.Persistence.Adapter\\Generator.Persistence.Adapter.csproj" 28 | }, 29 | { 30 | "path": "Generator.RestAdapter\\Generator.RestAdapter.csproj" 31 | }, 32 | { 33 | "path": "Generator.Domain.UnitTest\\Generator.Domain.UnitTest.csproj" 34 | }, 35 | { 36 | "path": "Generator.DomainApi.UnitTest\\Generator.DomainApi.UnitTest.csproj" 37 | }, 38 | { 39 | "path": "Generator.Persistence.Adapter.UnitTest\\Generator.Persistence.Adapter.UnitTest.csproj" 40 | }, 41 | { 42 | "path": "Generator.RestAdapter.UnitTest\\Generator.RestAdapter.UnitTest.csproj" 43 | } 44 | ] 45 | } -------------------------------------------------------------------------------- /src/.template.config/template.vstemplate: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hexa Architecture 5 | Hexagonal Architecture API solution template which is built on Domain-Driven Design (DDD)-based using .NET Core 6 | HexaArchitecture.CSharp 7 | HexaArchitecture 8 | 9 | project-icon.png 10 | 11 | CSharp 12 | 1 13 | 5000 14 | true 15 | true 16 | Enabled 17 | true 18 | C# 19 | windows 20 | WebAPI 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Microsoft.VisualStudio.TemplateEngine.Wizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 33 | Microsoft.VisualStudio.TemplateEngine.Wizard.TemplateEngineWizard 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/Generator.Domain.UnitTest/DealDomainTest.cs: -------------------------------------------------------------------------------- 1 | using Generator.DomainApi.Model; 2 | using Generator.Persistence.Adapter.UnitTest.Common; 3 | using NUnit.Framework; 4 | 5 | namespace Generator.Domain.UnitTest 6 | { 7 | public class DealDomainTest 8 | { 9 | private DealDomain _dealDomain; 10 | 11 | [Test] 12 | public void GetDealsTest() 13 | { 14 | using var context = ApplicationDbContextFactory.Create(); 15 | _dealDomain = new DealDomain(context); 16 | var deals = _dealDomain.GetDeals(); 17 | Assert.AreEqual(3, deals.Count); 18 | Assert.AreEqual(1, deals[0].Id); 19 | Assert.AreEqual("ABC", deals[0].Name); 20 | Assert.AreEqual("ABC deal 123", deals[0].Description); 21 | } 22 | 23 | [Test] 24 | public void GetDealByIdTest() 25 | { 26 | using var context = ApplicationDbContextFactory.Create(); 27 | _dealDomain = new DealDomain(context); 28 | var deals = _dealDomain.GetDeal(1); 29 | Assert.AreEqual(1, deals.Id); 30 | Assert.AreEqual("ABC", deals.Name); 31 | Assert.AreEqual("ABC deal 123", deals.Description); 32 | 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Generator.Domain.UnitTest/Generator.Domain.UnitTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Generator.Domain/DealDomain.cs: -------------------------------------------------------------------------------- 1 | using Generator.DomainApi.Port; 2 | using Generator.Persistence.Adapter.Context; 3 | using Microsoft.EntityFrameworkCore; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | 7 | namespace Generator.Domain 8 | { 9 | public class DealDomain : IRequestDeal where T : class 10 | { 11 | private readonly DbSet table; 12 | 13 | public DealDomain(ApplicationDbContext dbContext) 14 | { 15 | ApplicationDbContext _dbContext; 16 | _dbContext = dbContext; 17 | table = _dbContext.Set(); 18 | } 19 | public T GetDeal(int id) 20 | { 21 | return table.Find(id); 22 | } 23 | 24 | public List GetDeals() 25 | { 26 | return table.ToList(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Generator.Domain/DomainExtension.cs: -------------------------------------------------------------------------------- 1 | using Generator.DomainApi.Port; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace Generator.Domain 5 | { 6 | public static class DomainExtension 7 | { 8 | public static void AddDomain(this IServiceCollection serviceCollection) 9 | { 10 | serviceCollection.AddTransient(typeof(IRequestDeal<>), typeof(DealDomain<>)); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Generator.Domain/Generator.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Generator.DomainApi.UnitTest/Generator.DomainApi.UnitTest.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Generator.DomainApi.UnitTest/Model/DealInfoTest.cs: -------------------------------------------------------------------------------- 1 | using Generator.DomainApi.Model; 2 | using NUnit.Framework; 3 | using System.Collections.Generic; 4 | 5 | namespace Generator.DomainApi.UnitTest.Model 6 | { 7 | public class DealInfoTest 8 | { 9 | private readonly DealInfo _dealInfo; 10 | 11 | public DealInfoTest() 12 | { 13 | _dealInfo = new DealInfo(); 14 | } 15 | 16 | [Test] 17 | public void TestSetAndGetName() 18 | { 19 | _dealInfo.Deals = GetDeals(); 20 | Assert.IsTrue(_dealInfo.Deals.Count > 0); 21 | } 22 | 23 | private static List GetDeals() 24 | { 25 | return 26 | new List { new Deal { Description = "", Name = "" } }; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Generator.DomainApi.UnitTest/Model/DealTest.cs: -------------------------------------------------------------------------------- 1 | using Generator.DomainApi.Model; 2 | using NUnit.Framework; 3 | 4 | namespace Generator.DomainApi.UnitTest.Model 5 | { 6 | public class DealTest 7 | { 8 | private readonly Deal _deal; 9 | private const string Name = "Test Deal name"; 10 | private const string Description = "Test Deal description"; 11 | 12 | public DealTest() 13 | { 14 | _deal = new Deal(); 15 | } 16 | 17 | [Test] 18 | public void TestSetAndGetName() 19 | { 20 | _deal.Name = Name; 21 | Assert.AreEqual(Name, _deal.Name); 22 | } 23 | 24 | [Test] 25 | public void TestSetAndGetDescription() 26 | { 27 | _deal.Description = Description; 28 | Assert.AreEqual(Description, _deal.Description); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Generator.DomainApi/BaseEntity.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Generator.DomainApi 4 | { 5 | public class BaseEntity 6 | { 7 | [Key] 8 | public TKey Id { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Generator.DomainApi/Generator.DomainApi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Generator.DomainApi/Model/Deal.cs: -------------------------------------------------------------------------------- 1 | namespace Generator.DomainApi.Model 2 | { 3 | public class Deal : BaseEntity 4 | { 5 | public string Name { get; set; } 6 | public string Description { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Generator.DomainApi/Model/DealInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Generator.DomainApi.Model 4 | { 5 | public class DealInfo 6 | { 7 | public List Deals { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Generator.DomainApi/Port/IObtainDeal.cs: -------------------------------------------------------------------------------- 1 | using Generator.DomainApi.Model; 2 | using System.Collections.Generic; 3 | 4 | namespace Generator.DomainApi.Port 5 | { 6 | public interface IObtainDeal 7 | { 8 | List GetDeals(); 9 | Deal GetDeal(T id); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Generator.DomainApi/Port/IRequestDeal.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Generator.DomainApi.Port 4 | { 5 | public interface IRequestDeal 6 | { 7 | List GetDeals(); 8 | T GetDeal(int id); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Generator.DomainApi/Services/AppSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Generator.DomainApi.Services 2 | { 3 | public class AppSettings 4 | { 5 | public ApplicationDetail ApplicationDetail { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Generator.DomainApi/Services/ApplicationDetail.cs: -------------------------------------------------------------------------------- 1 | namespace Generator.DomainApi.Services 2 | { 3 | public class ApplicationDetail 4 | { 5 | public string ApplicationName { get; set; } 6 | public string Description { get; set; } 7 | public string ContactWebsite { get; set; } 8 | public string LicenseDetail { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Generator.Persistence.Adapter.UnitTest/Common/ApplicationDbContextFactory.cs: -------------------------------------------------------------------------------- 1 | using Generator.DomainApi.Model; 2 | using Generator.Persistence.Adapter.Context; 3 | using Microsoft.EntityFrameworkCore; 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | namespace Generator.Persistence.Adapter.UnitTest.Common 8 | { 9 | public static class ApplicationDbContextFactory 10 | { 11 | public static List GetDeals() 12 | { 13 | return new List() 14 | { 15 | new Deal(){Id=1, Name="ABC", Description="ABC deal 123"}, 16 | new Deal(){Id=2, Name="ABC", Description="ABC deal 456"}, 17 | new Deal(){Id=3, Name="ABC", Description="ABC deal 789"}, 18 | }; 19 | } 20 | 21 | public static ApplicationDbContext Create() 22 | { 23 | var options = new DbContextOptionsBuilder() 24 | .UseInMemoryDatabase(Guid.NewGuid().ToString()) 25 | .Options; 26 | 27 | var context = new ApplicationDbContext(options); 28 | context.Database.EnsureCreated(); 29 | context.Deals.AddRange(GetDeals()); 30 | context.SaveChanges(); 31 | return context; 32 | } 33 | public static void Destroy(ApplicationDbContext dbContext) 34 | { 35 | dbContext.Database.EnsureDeleted(); 36 | dbContext.Dispose(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Generator.Persistence.Adapter.UnitTest/Context/ApplicationDbContextTest.cs: -------------------------------------------------------------------------------- 1 | using Generator.DomainApi.Model; 2 | using Generator.Persistence.Adapter.UnitTest.Common; 3 | using Microsoft.EntityFrameworkCore; 4 | using NUnit.Framework; 5 | using System.Threading.Tasks; 6 | 7 | namespace Generator.Persistence.Adapter.UnitTest.Context 8 | { 9 | public class ApplicationDbContextTest 10 | { 11 | [Test] 12 | public void CanInsertDealIntoDatabase() 13 | { 14 | using var context = ApplicationDbContextFactory.Create(); 15 | var Deal = new Deal(); 16 | context.Deals.Add(Deal); 17 | Assert.AreEqual(EntityState.Added, context.Entry(Deal).State); 18 | 19 | var result = context.SaveChangesAsync(); 20 | Assert.AreEqual(1, result.Result); 21 | Assert.AreEqual(Task.CompletedTask.Status, result.Status); 22 | Assert.AreEqual(EntityState.Unchanged, context.Entry(Deal).State); 23 | 24 | } 25 | 26 | [Test] 27 | public void CanDeleteDealIntoDatabase() 28 | { 29 | using var context = ApplicationDbContextFactory.Create(); 30 | var Deal = new Deal(); 31 | context.Deals.Remove(Deal); 32 | Assert.AreEqual(EntityState.Deleted, context.Entry(Deal).State); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Generator.Persistence.Adapter.UnitTest/Generator.Persistence.Adapter.UnitTest.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Generator.Persistence.Adapter/Context/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using Generator.DomainApi.Model; 2 | using Microsoft.EntityFrameworkCore; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | 6 | namespace Generator.Persistence.Adapter.Context 7 | { 8 | public class ApplicationDbContext : DbContext 9 | { 10 | public ApplicationDbContext() 11 | { 12 | } 13 | public ApplicationDbContext(DbContextOptions options) : base(options) 14 | { 15 | } 16 | 17 | public DbSet Deals { get; set; } 18 | 19 | public override Task SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken()) 20 | { 21 | return base.SaveChangesAsync(cancellationToken); 22 | } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Generator.Persistence.Adapter/Generator.Persistence.Adapter.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Generator.Persistence.Adapter/PersistenceExtensions.cs: -------------------------------------------------------------------------------- 1 | using Generator.Persistence.Adapter.Context; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | namespace Generator.Persistence.Adapter 6 | { 7 | public static class PersistenceExtensions 8 | { 9 | public static void AddPersistence(this IServiceCollection serviceCollection) 10 | { 11 | serviceCollection.AddDbContext(options => 12 | options.UseInMemoryDatabase("HexaArchConnInMemoryDb")); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Generator.RestAdapter.UnitTest/Controllers/DealControllerTest.cs: -------------------------------------------------------------------------------- 1 | using Generator.DomainApi.Model; 2 | using Generator.DomainApi.Port; 3 | using Generator.RestAdapter.Controllers.v1; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Moq; 6 | using NUnit.Framework; 7 | 8 | namespace Generator.RestAdapter.UnitTest.Controllers 9 | { 10 | public class DealControllerTest 11 | { 12 | private DealController _controller; 13 | private Mock> _requestDealMock; 14 | 15 | [SetUp] 16 | public void Setup() 17 | { 18 | _requestDealMock = new Mock>(); 19 | _controller = new DealController(_requestDealMock.Object); 20 | } 21 | 22 | [Test] 23 | public void GetAllDealTestOkResult() 24 | { 25 | var response = _controller.Get(); 26 | Assert.IsInstanceOf(response); 27 | } 28 | 29 | [Test] 30 | public void GetAllDealByIdTestOkResult() 31 | { 32 | var response = _controller.Get(1); 33 | Assert.IsInstanceOf(response); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Generator.RestAdapter.UnitTest/Generator.RestAdapter.UnitTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Generator.RestAdapter/Controllers/v1/DealController.cs: -------------------------------------------------------------------------------- 1 | using Generator.DomainApi.Model; 2 | using Generator.DomainApi.Port; 3 | using Microsoft.AspNetCore.Mvc; 4 | 5 | namespace Generator.RestAdapter.Controllers.v1 6 | { 7 | [ApiController] 8 | [Route("api/v{version:apiVersion}/[controller]")] 9 | public class DealController : ControllerBase 10 | { 11 | private readonly IRequestDeal _requestDeal; 12 | 13 | public DealController(IRequestDeal requestDeal) 14 | { 15 | _requestDeal = requestDeal; 16 | } 17 | 18 | // GET: api/deal 19 | [HttpGet] 20 | public IActionResult Get() 21 | { 22 | var result = _requestDeal.GetDeals(); 23 | return Ok(result); 24 | } 25 | 26 | // GET: api/deal/1 27 | [HttpGet] 28 | [Route("{id}", Name = "GetDeal")] 29 | public IActionResult Get(int id) 30 | { 31 | var result = _requestDeal.GetDeal(id); 32 | return Ok(result); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Generator.RestAdapter/Generator.RestAdapter.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Generator/Controllers/MetaController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using System.Diagnostics; 3 | 4 | namespace Generator.Controllers 5 | { 6 | public class MetaController : ControllerBase 7 | { 8 | [HttpGet("/info")] 9 | public ActionResult Info() 10 | { 11 | var assembly = typeof(Startup).Assembly; 12 | 13 | var lastUpdate = System.IO.File.GetLastWriteTime(assembly.Location); 14 | var version = FileVersionInfo.GetVersionInfo(assembly.Location).ProductVersion; 15 | 16 | return Ok($"Version: {version}, Last Updated: {lastUpdate}"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Generator/Extension/ConfigureContainer.cs: -------------------------------------------------------------------------------- 1 | using HealthChecks.UI.Client; 2 | using Microsoft.AspNetCore.Builder; 3 | using Microsoft.AspNetCore.Diagnostics.HealthChecks; 4 | using Microsoft.AspNetCore.Http; 5 | using Microsoft.Extensions.Diagnostics.HealthChecks; 6 | 7 | namespace Generator.Extension 8 | { 9 | public static class ConfigureContainer 10 | { 11 | public static void UseSwaggerConfig(this IApplicationBuilder app) 12 | { 13 | app.UseSwagger(); 14 | 15 | app.UseSwaggerUI(setupAction => 16 | { 17 | setupAction.SwaggerEndpoint("/swagger/v1/swagger.json", "Hexagonal Architecture API"); 18 | setupAction.RoutePrefix = string.Empty; 19 | }); 20 | } 21 | 22 | public static void UseHealthCheck(this IApplicationBuilder app) 23 | { 24 | app.UseHealthChecks("/healthz", new HealthCheckOptions 25 | { 26 | Predicate = _ => true, 27 | ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse, 28 | ResultStatusCodes = 29 | { 30 | [HealthStatus.Healthy] = StatusCodes.Status200OK, 31 | [HealthStatus.Degraded] = StatusCodes.Status500InternalServerError, 32 | [HealthStatus.Unhealthy] = StatusCodes.Status503ServiceUnavailable, 33 | }, 34 | }).UseHealthChecksUI(setup => 35 | { 36 | setup.ApiPath = "/healthcheck"; 37 | setup.UIPath = "/healthcheck-ui"; 38 | }); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Generator/Extension/ConfigureServiceContainer.cs: -------------------------------------------------------------------------------- 1 | using Generator.DomainApi.Services; 2 | using Generator.Persistence.Adapter.Context; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using Microsoft.Extensions.Diagnostics.HealthChecks; 6 | using Microsoft.OpenApi.Models; 7 | using System; 8 | using System.Collections.Generic; 9 | 10 | namespace Generator.Extension 11 | { 12 | public static class ConfigureServiceContainer 13 | { 14 | public static void AddSwaggerOpenAPI(this IServiceCollection serviceCollection, AppSettings appSettings) 15 | { 16 | serviceCollection.AddSwaggerGen(setupAction => 17 | { 18 | setupAction.SwaggerDoc( 19 | "v1", 20 | new Microsoft.OpenApi.Models.OpenApiInfo() 21 | { 22 | Title = appSettings.ApplicationDetail.ApplicationName, 23 | Version = "v1", 24 | Description = appSettings.ApplicationDetail.Description, 25 | }); 26 | setupAction.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme 27 | { 28 | Type = SecuritySchemeType.Http, 29 | Scheme = "bearer", 30 | BearerFormat = "JWT", 31 | Description = $"Input your Bearer token in this format - Bearer token to access this API", 32 | }); 33 | setupAction.AddSecurityRequirement(new OpenApiSecurityRequirement 34 | { 35 | { 36 | new OpenApiSecurityScheme 37 | { 38 | Reference = new OpenApiReference 39 | { 40 | Type = ReferenceType.SecurityScheme, 41 | Id = "Bearer", 42 | }, 43 | }, new List() 44 | }, 45 | }); 46 | }); 47 | } 48 | 49 | public static void AddApiVersion(this IServiceCollection serviceCollection) 50 | { 51 | serviceCollection.AddApiVersioning(config => 52 | { 53 | config.DefaultApiVersion = new ApiVersion(1, 0); 54 | config.AssumeDefaultVersionWhenUnspecified = true; 55 | config.ReportApiVersions = true; 56 | }); 57 | } 58 | 59 | public static void AddHealthCheck(this IServiceCollection serviceCollection, AppSettings appSettings) 60 | { 61 | serviceCollection.AddHealthChecks() 62 | .AddDbContextCheck(name: "Application DB Context", failureStatus: HealthStatus.Degraded) 63 | .AddUrlGroup(new Uri(appSettings.ApplicationDetail.ContactWebsite), name: "My personal website", failureStatus: HealthStatus.Degraded); 64 | 65 | serviceCollection.AddHealthChecksUI(setupSettings: setup => 66 | { 67 | setup.AddHealthCheckEndpoint("Basic Health Check", $"/healthz"); 68 | }).AddInMemoryStorage(); 69 | 70 | 71 | } 72 | 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/Generator/Generator.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/Generator/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace Generator 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Generator/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:59038", 8 | "sslPort": 44377 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "OpenAPI/index.html", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "Generator": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "OpenAPI/index.html", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Generator/Startup.cs: -------------------------------------------------------------------------------- 1 | using Generator.Domain; 2 | using Generator.DomainApi.Services; 3 | using Generator.Extension; 4 | using Generator.Persistence.Adapter; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.Extensions.Configuration; 8 | using Microsoft.Extensions.DependencyInjection; 9 | using Microsoft.Extensions.Hosting; 10 | using Microsoft.Extensions.Logging; 11 | using Serilog; 12 | 13 | namespace Generator 14 | { 15 | public class Startup 16 | { 17 | public IConfiguration Configuration { get; } 18 | private AppSettings AppSettings { get; set; } 19 | 20 | public Startup(IConfiguration configuration) 21 | { 22 | Configuration = configuration; 23 | 24 | AppSettings = new AppSettings(); 25 | Configuration.Bind(AppSettings); 26 | } 27 | 28 | public void ConfigureServices(IServiceCollection services) 29 | { 30 | services.AddControllers(); 31 | 32 | services.AddPersistence(); 33 | 34 | services.AddDomain(); 35 | 36 | services.AddSwaggerOpenAPI(AppSettings); 37 | 38 | services.AddApiVersion(); 39 | 40 | services.AddHealthCheck(AppSettings); 41 | 42 | } 43 | 44 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory log) 45 | { 46 | if (env.IsDevelopment()) 47 | { 48 | app.UseDeveloperExceptionPage(); 49 | } 50 | 51 | app.UseHttpsRedirection(); 52 | 53 | app.UseRouting(); 54 | 55 | app.UseAuthentication(); 56 | 57 | app.UseAuthorization(); 58 | 59 | app.UseSwaggerConfig(); 60 | 61 | app.UseHealthCheck(); 62 | 63 | log.AddSerilog(); 64 | 65 | app.UseEndpoints(endpoints => 66 | { 67 | endpoints.MapControllers(); 68 | }); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/Generator/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Generator/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApplicationDetail": { 3 | "ApplicationName": "Hexagonal Architecture API", 4 | "Description": "Through this WebAPI you can access details", 5 | "ContactWebsite": "https://amitpnk.github.io/", 6 | "LicenseDetail": "https://opensource.org/licenses/MIT" 7 | }, 8 | "Logging": { 9 | "LogLevel": { 10 | "Default": "Information", 11 | "Microsoft": "Warning", 12 | "Microsoft.Hosting.Lifetime": "Information" 13 | } 14 | }, 15 | "Serilog": { 16 | "MinimumLevel": "Information", 17 | "WriteTo": [ 18 | { 19 | "Name": "RollingFile", 20 | "Args": { 21 | "pathFormat": "D:\\Logs\\Hexagonal-log-{Date}.log", 22 | "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}" 23 | } 24 | } 25 | ], 26 | "Properties": { 27 | "Application": "Hexagonal Architecture application" 28 | } 29 | }, 30 | "AllowedHosts": "*" 31 | } 32 | -------------------------------------------------------------------------------- /src/HexaVSIX.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30717.126 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator", "Generator\Generator.csproj", "{1669E311-49AC-44E7-B3FC-7CC3C26662F0}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator.DomainApi", "Generator.DomainApi\Generator.DomainApi.csproj", "{10AAF466-3F4A-47E0-9E75-9737B19B46AF}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator.Domain", "Generator.Domain\Generator.Domain.csproj", "{C2D44FE4-410D-408C-8435-CCCB77C4339E}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator.Persistence.Adapter", "Generator.Persistence.Adapter\Generator.Persistence.Adapter.csproj", "{8291FB65-54AF-4D64-AE68-B4F64E33DBE1}" 13 | EndProject 14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator.RestAdapter", "Generator.RestAdapter\Generator.RestAdapter.csproj", "{AD28F426-0678-452C-9D95-CB14703D8756}" 15 | EndProject 16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Template", "Template\Template.csproj", "{FA557DAF-FEF3-4225-A467-53B63E6EEC8F}" 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator.Domain.UnitTest", "Generator.Domain.UnitTest\Generator.Domain.UnitTest.csproj", "{4BED05BB-3B4A-4D25-82F6-37EFA7587314}" 19 | EndProject 20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator.DomainApi.UnitTest", "Generator.DomainApi.UnitTest\Generator.DomainApi.UnitTest.csproj", "{F5058CEB-EFF0-439B-A230-480A702CEEAC}" 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator.Persistence.Adapter.UnitTest", "Generator.Persistence.Adapter.UnitTest\Generator.Persistence.Adapter.UnitTest.csproj", "{DF38D154-5A4E-461F-BA72-C47BE6C4405A}" 23 | EndProject 24 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator.RestAdapter.UnitTest", "Generator.RestAdapter.UnitTest\Generator.RestAdapter.UnitTest.csproj", "{AB8835EF-ED5D-4F0B-A0D9-99F0359BEFC6}" 25 | EndProject 26 | Global 27 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 28 | Debug|Any CPU = Debug|Any CPU 29 | Release|Any CPU = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 32 | {1669E311-49AC-44E7-B3FC-7CC3C26662F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {1669E311-49AC-44E7-B3FC-7CC3C26662F0}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {1669E311-49AC-44E7-B3FC-7CC3C26662F0}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {1669E311-49AC-44E7-B3FC-7CC3C26662F0}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {10AAF466-3F4A-47E0-9E75-9737B19B46AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {10AAF466-3F4A-47E0-9E75-9737B19B46AF}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {10AAF466-3F4A-47E0-9E75-9737B19B46AF}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {10AAF466-3F4A-47E0-9E75-9737B19B46AF}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {C2D44FE4-410D-408C-8435-CCCB77C4339E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {C2D44FE4-410D-408C-8435-CCCB77C4339E}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {C2D44FE4-410D-408C-8435-CCCB77C4339E}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {C2D44FE4-410D-408C-8435-CCCB77C4339E}.Release|Any CPU.Build.0 = Release|Any CPU 44 | {8291FB65-54AF-4D64-AE68-B4F64E33DBE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 45 | {8291FB65-54AF-4D64-AE68-B4F64E33DBE1}.Debug|Any CPU.Build.0 = Debug|Any CPU 46 | {8291FB65-54AF-4D64-AE68-B4F64E33DBE1}.Release|Any CPU.ActiveCfg = Release|Any CPU 47 | {8291FB65-54AF-4D64-AE68-B4F64E33DBE1}.Release|Any CPU.Build.0 = Release|Any CPU 48 | {AD28F426-0678-452C-9D95-CB14703D8756}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 49 | {AD28F426-0678-452C-9D95-CB14703D8756}.Debug|Any CPU.Build.0 = Debug|Any CPU 50 | {AD28F426-0678-452C-9D95-CB14703D8756}.Release|Any CPU.ActiveCfg = Release|Any CPU 51 | {AD28F426-0678-452C-9D95-CB14703D8756}.Release|Any CPU.Build.0 = Release|Any CPU 52 | {FA557DAF-FEF3-4225-A467-53B63E6EEC8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 53 | {FA557DAF-FEF3-4225-A467-53B63E6EEC8F}.Debug|Any CPU.Build.0 = Debug|Any CPU 54 | {FA557DAF-FEF3-4225-A467-53B63E6EEC8F}.Release|Any CPU.ActiveCfg = Release|Any CPU 55 | {FA557DAF-FEF3-4225-A467-53B63E6EEC8F}.Release|Any CPU.Build.0 = Release|Any CPU 56 | {4BED05BB-3B4A-4D25-82F6-37EFA7587314}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 57 | {4BED05BB-3B4A-4D25-82F6-37EFA7587314}.Debug|Any CPU.Build.0 = Debug|Any CPU 58 | {4BED05BB-3B4A-4D25-82F6-37EFA7587314}.Release|Any CPU.ActiveCfg = Release|Any CPU 59 | {4BED05BB-3B4A-4D25-82F6-37EFA7587314}.Release|Any CPU.Build.0 = Release|Any CPU 60 | {F5058CEB-EFF0-439B-A230-480A702CEEAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 61 | {F5058CEB-EFF0-439B-A230-480A702CEEAC}.Debug|Any CPU.Build.0 = Debug|Any CPU 62 | {F5058CEB-EFF0-439B-A230-480A702CEEAC}.Release|Any CPU.ActiveCfg = Release|Any CPU 63 | {F5058CEB-EFF0-439B-A230-480A702CEEAC}.Release|Any CPU.Build.0 = Release|Any CPU 64 | {DF38D154-5A4E-461F-BA72-C47BE6C4405A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 65 | {DF38D154-5A4E-461F-BA72-C47BE6C4405A}.Debug|Any CPU.Build.0 = Debug|Any CPU 66 | {DF38D154-5A4E-461F-BA72-C47BE6C4405A}.Release|Any CPU.ActiveCfg = Release|Any CPU 67 | {DF38D154-5A4E-461F-BA72-C47BE6C4405A}.Release|Any CPU.Build.0 = Release|Any CPU 68 | {AB8835EF-ED5D-4F0B-A0D9-99F0359BEFC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 69 | {AB8835EF-ED5D-4F0B-A0D9-99F0359BEFC6}.Debug|Any CPU.Build.0 = Debug|Any CPU 70 | {AB8835EF-ED5D-4F0B-A0D9-99F0359BEFC6}.Release|Any CPU.ActiveCfg = Release|Any CPU 71 | {AB8835EF-ED5D-4F0B-A0D9-99F0359BEFC6}.Release|Any CPU.Build.0 = Release|Any CPU 72 | EndGlobalSection 73 | GlobalSection(SolutionProperties) = preSolution 74 | HideSolutionNode = FALSE 75 | EndGlobalSection 76 | GlobalSection(ExtensibilityGlobals) = postSolution 77 | SolutionGuid = {3BBF5BAC-DFC4-4FF9-B4C2-DD935FC10F1A} 78 | EndGlobalSection 79 | EndGlobal 80 | -------------------------------------------------------------------------------- /src/Template/Hexagonal-arch-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/61c16728842679c7d768723685c4046d158bb78c/src/Template/Hexagonal-arch-logo.png -------------------------------------------------------------------------------- /src/Template/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Amit P Naik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /src/Template/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("TemplateProject")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("TemplateProject")] 12 | [assembly: AssemblyCopyright("")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // Version information for an assembly consists of the following four values: 22 | // 23 | // Major Version 24 | // Minor Version 25 | // Build Number 26 | // Revision 27 | // 28 | // You can specify all the values or you can default the Build and Revision Numbers 29 | // by using the '*' as shown below: 30 | // [assembly: AssemblyVersion("1.0.*")] 31 | [assembly: AssemblyVersion("1.0.0.0")] 32 | [assembly: AssemblyFileVersion("1.0.0.0")] 33 | -------------------------------------------------------------------------------- /src/Template/Properties/project-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/61c16728842679c7d768723685c4046d158bb78c/src/Template/Properties/project-icon.png -------------------------------------------------------------------------------- /src/Template/Properties/wafflebuilder.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | $(MSBuildThisFileFullPath).props 17 | 18 | 19 | 21 | 22 | 23 | Debug 24 | $(MSBuildProjectDirectory)\..\ 25 | bin\$(Configuration)\templates\ 26 | CSharp\Web\SideWaffle 27 | 28 | 29 | 32 | 33 | $(MSBuildThisFileDirectory) 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | $(ProcessTemplatesDependsOn); 42 | BuildTemplateNuGetPackages; 43 | BuildVsTemplateFiles; 44 | 45 | 46 | 47 | 50 | 51 | 54 | 55 | 56 | $(BuildTemplateNuGetPackagesDependsOn); 57 | FindTemplatePackProjFiles; 58 | BuildTemplatePackNuGetProjFiles; 59 | AddTemplateNuGetPackagesToVsix; 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 75 | 76 | 77 | <_cTemplateProj Condition=" '%(TemplatePackNuGetProj.Identity)' != '' ">%(TemplatePackNuGetProj.Identity) 78 | <_cTemplateProj Condition=" '$(_cTemplateProj)' != '' ">$([System.IO.Path]::GetFullPath('$(_cTemplateProj)')) 79 | <_templateOutputPathFull>$([System.IO.Path]::GetFullPath('$(TemplateOutputPath)')) 80 | 81 | 82 | 83 | 84 | 85 | 86 | 90 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | <_templateOutputFullpath>$([System.IO.Path]::GetFullPath('$(TemplateOutputPath)')) 102 | 103 | 104 | 105 | <_templateNuGetPkgs Include="$(_templateOutputFullpath)**/*.nupkg" 106 | Exclude="$(TemplateNuGetPackagesToExcludeFromVsix)" /> 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 119 | 120 | 121 | $(BuildVsTemplateFilesDependsOn); 122 | FindVstemplateFiles; 123 | BuildZipForVstemplateFiles; 124 | 125 | 126 | $(VsTemplateFilesExclude); 127 | $(TemplateSourceRoot)**\bin\**\*; 128 | $(TemplateSourceRoot)**\obj\**\*; 129 | 130 | 131 | 132 | 133 | 134 | 136 | 137 | <_vsTemplateExcludeFiles Include="$(VsTemplateFilesExclude)"/> 138 | <_vstemplateTemp Include="$(TemplateSourceRoot)**/*.vstemplate" Exclude="@(_vsTemplateExcludeFiles)" /> 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | <_templateGetNewProjectNodeXpath Condition=" '$(_templateGetNewProjectNodeXpath)'=='' ">dft:VSTemplate/dft:TemplateContent/dft:CustomParameters/dft:CustomParameter[@Name='SideWaffleNewProjNode']/@Value 149 | 150 | 151 | 153 | 154 | 155 | <_filename>%(VsTemplateFiles.Filename) 156 | <_zipoutfile>$(TemplateOutputPath)$(_filename).zip 157 | <_ziprootdir>%(VsTemplateZipDefaultFiles.RootDir)%(VsTemplateZipDefaultFiles.Directory) 158 | <_vstemplatedir>$([System.IO.Path]::GetFullPath('%(VsTemplateFiles.RootDir)%(VsTemplateFiles.Directory)')) 159 | <_vstemplatefullpath>$([System.IO.Path]::GetFullPath('%(VsTemplateFiles.Fullpath)')) 160 | 161 | 168 | 169 | 170 | 172 | 173 | 177 | 178 | <_filename>%(VsTemplateFiles.Filename) 179 | <_zipoutfile>$([System.IO.Path]::GetFullPath('$(TemplateOutputPath)$(_filename).zip')) 180 | <_ziprootdir>$([System.IO.Path]::GetFullPath('%(VsTemplateZipDefaultFiles.RootDir)%(VsTemplateZipDefaultFiles.Directory)')) 181 | <_vstemplatedir>$([System.IO.Path]::GetFullPath('%(VsTemplateFiles.RootDir)%(VsTemplateFiles.Directory)')) 182 | <_vstemplatefullpath>$([System.IO.Path]::GetFullPath('%(VsTemplateFiles.Fullpath)')) 183 | 184 | 185 | 186 | 187 | 191 | 192 | 193 | <_templatefilestoadd Remove="@(_templatefilestoadd)"/> 194 | <_templatefilestoadd Include="$(_vstemplatedir)**/*"/> 195 | 196 | 201 | 202 | 203 | <_npdNodeXpath>dft:VSTemplate/dft:TemplateContent/dft:CustomParameters/dft:CustomParameter[@Name='SideWaffleNewProjNode']/@Value 204 | <_ls-templateFilePath>%(ls-VsNewProjTemplateFiles.FullPath) 205 | http://schemas.microsoft.com/developer/vstemplate/2005 206 | 207 | 210 | 211 | 212 | 213 | 214 | <_npdNode Condition=" '$(_npdNode)'=='' ">$(DefaultNewProjectNode) 215 | <_npdNode Condition="!HasTrailingSlash('$_npdNode')">$(_npdNode)\ 216 | <_fullNpdNode>Output\Templates\$(_npdNode) 217 | 218 | 219 | 220 | 221 | 222 | $(_fullNpdNode) 223 | 224 | 225 | 226 | 227 | 230 | 231 | $(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll 232 | $(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll 233 | $(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll 234 | $(MSBuildFrameworkToolsPath)\Microsoft.Build.Tasks.v4.0.dll 235 | $(windir)\Microsoft.NET\Framework\v4.0.30319\Microsoft.Build.Tasks.v4.0.dll 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | (); 287 | // if the file is already in the zip remove it and add again 288 | if (zip.Entries != null && zip.Entries.Count > 0) { 289 | List entries = zip.Entries.ToList(); 290 | foreach (var entry in entries) { 291 | if (entry.FullName.Equals(relpath, StringComparison.OrdinalIgnoreCase)) { 292 | // entriesToDelete.Add(entry); 293 | Log.LogMessage(MessageImportance.Low, "deleting zip entry for [{0}]", relpath); 294 | entry.Delete(); 295 | } 296 | } 297 | } 298 | //if(entriesToDelete != null && entriesToDelete.Count > 0){ 299 | // foreach(var entry in entriesToDelete) { 300 | // try { 301 | // entry.Delete(); 302 | // } 303 | // catch(Exception ex){ 304 | // Log.LogMessage(MessageImportance.Low, "Unable to delete entry from zip. {0}", ex.ToString()); 305 | // } 306 | // } 307 | //} 308 | ZipFileExtensions.CreateEntryFromFile(zip, filePath, relpath, level); 309 | } 310 | } 311 | } 312 | catch(Exception ex){ 313 | Log.LogError(ex.ToString()); 314 | return false; 315 | } 316 | 317 | return true; 318 | ]]> 319 | 320 | 321 | 322 | 323 | -------------------------------------------------------------------------------- /src/Template/Resources/Hexagonal-arch-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/61c16728842679c7d768723685c4046d158bb78c/src/Template/Resources/Hexagonal-arch-logo.png -------------------------------------------------------------------------------- /src/Template/Template.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 15.0 6 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 7 | Program 8 | $(DevEnvDir)\devenv.exe 9 | /rootsuffix Exp 10 | 11 | 12 | 13 | Debug 14 | AnyCPU 15 | 2.0 16 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 17 | {FA557DAF-FEF3-4225-A467-53B63E6EEC8F} 18 | Library 19 | Properties 20 | Template 21 | Template 22 | v4.6 23 | false 24 | false 25 | false 26 | false 27 | false 28 | false 29 | 30 | 31 | true 32 | full 33 | false 34 | bin\Debug\ 35 | DEBUG;TRACE 36 | prompt 37 | 4 38 | 39 | 40 | pdbonly 41 | true 42 | bin\Release\ 43 | TRACE 44 | prompt 45 | 4 46 | 47 | 48 | 49 | 50 | 51 | 52 | Designer 53 | 54 | 55 | Designer 56 | 57 | 58 | 59 | 60 | 61 | Always 62 | true 63 | 64 | 65 | Always 66 | true 67 | 68 | 69 | Always 70 | true 71 | 72 | 73 | 74 | Always 75 | true 76 | 77 | 78 | 79 | true 80 | 81 | 82 | 83 | 84 | 85 | $(MSBuildProjectDirectory)\Properties\wafflebuilder.targets 86 | 87 | 88 | 89 | 90 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 91 | 92 | 93 | 94 | 101 | -------------------------------------------------------------------------------- /src/Template/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | Getting Started 9 | 10 | 11 | 12 |
13 | 17 | 18 |
19 |
20 |

Creating a Visual Studio Extension

21 | 22 |

This project enables developers to create an extension for Visual Studio. The solution contains a VSIX project that packages the extension into a VSIX file. This file is used to install an extension for Visual Studio.

23 |

Add new features

24 | 25 |
    26 |
  1. Right-click the project node in Solution Explorer and select Add>New Item.
  2. 27 |
  3. In the Add New Item dialog box, expand the Extensibility node under Visual C# or Visual Basic.
  4. 28 |
  5. Choose from the available item templates: Visual Studio Package, Editor Items (Classifier, Margin, Text Adornment, Viewport Adornment), Command, Tool Window, Toolbox Control, and then click Add.
  6. 29 |
30 | 31 |

The files for the template that you selected are added to the project. You can start adding functionality to your item template, press F5 to run the project, or add additional item templates.

32 | 33 |

Run and debug

34 |

To run the project, press F5. Visual Studio will:

35 | 36 |
    37 |
  • Build the extension from the VSIX project.
  • 38 |
  • Create a VSIX package from the VSIX project.
  • 39 |
  • When debugging, start an experimental instance of Visual Studio with the VSIX package installed.
  • 40 |
41 | 42 |

In the experimental instance of Visual Studio you can test out the functionality of your extension without affecting your Visual Studio installation.

43 | 44 |
45 |
46 |
47 |

Visual Studio Extensibility Resources

48 | 49 |
    50 |
  1. Visual Studio documentation
    Detailed documentation and API reference material for building extensions.
  2. 51 |
  3. Extension samples on GitHub
    Use a sample project to kickstart your development.
  4. 52 |
  5. Extensibility chat room on Gitter
    Meet other extension developers and exchange tips and tricks for extension development.
  6. 53 |
  7. Channel 9 videos on extensibility
    Watch videos from the product team on Visual Studio extensibility.
  8. 54 |
  9. Extensibility Tools
    Install an optional helper tool that adds extra IDE support for extension authors.
  10. 55 |
56 |

Give us feedback

57 | 60 |
61 |
62 |
63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /src/Template/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Amitpnk/Hexagonal-architecture-ASP.NET-Core/61c16728842679c7d768723685c4046d158bb78c/src/Template/logo.jpg -------------------------------------------------------------------------------- /src/Template/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hexagonal Architecture 6 | Hexagonal Architecture Web API solution template which is built on Domain-Driven Design (DDD)-based using .NET Core 7 | LICENSE.txt 8 | Resources\Hexagonal-arch-logo.png 9 | Resources\Hexagonal-arch-logo.png 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/Template/stylesheet.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | border: 0; 5 | color: #1E1E1E; 6 | font-size: 13px; 7 | font-family: "Segoe UI", Helvetica, Arial, sans-serif; 8 | line-height: 1.45; 9 | word-wrap: break-word; 10 | } 11 | 12 | /* General & 'Reset' Stuff */ 13 | 14 | 15 | .container { 16 | width: 980px; 17 | margin: 0 auto; 18 | } 19 | 20 | section { 21 | display: block; 22 | margin: 0; 23 | } 24 | 25 | h1, h2, h3, h4, h5, h6 { 26 | margin: 0; 27 | } 28 | 29 | /* Header,
30 | header - container 31 | h1 - project name 32 | h2 - project description 33 | */ 34 | 35 | #header { 36 | color: #FFF; 37 | background: #68217a; 38 | position:relative; 39 | } 40 | #hangcloud { 41 | width: 190px; 42 | height: 160px; 43 | background: url("../images/bannerart03.png"); 44 | position: absolute; 45 | top: 0; 46 | right: -30px; 47 | } 48 | h1, h2 { 49 | font-family: "Segoe UI Light", "Segoe UI", Helvetica, Arial, sans-serif; 50 | line-height: 1; 51 | margin: 0 18px; 52 | padding: 0; 53 | } 54 | #header h1 { 55 | font-size: 3.4em; 56 | padding-top: 18px; 57 | font-weight: normal; 58 | margin-left: 15px; 59 | } 60 | 61 | #header h2 { 62 | font-size: 1.5em; 63 | margin-top: 10px; 64 | padding-bottom: 18px; 65 | font-weight: normal; 66 | } 67 | 68 | 69 | #main_content { 70 | width: 100%; 71 | display: flex; 72 | flex-direction: row; 73 | } 74 | 75 | 76 | h1, h2, h3, h4, h5, h6 { 77 | font-weight: bolder; 78 | } 79 | 80 | #main_content h1 { 81 | font-size: 1.8em; 82 | margin-top: 34px; 83 | } 84 | 85 | #main_content h1:first-child { 86 | margin-top: 30px; 87 | } 88 | 89 | #main_content h2 { 90 | font-size: 1.4em; 91 | font-weight: bold; 92 | } 93 | p, ul { 94 | margin: 11px 18px; 95 | } 96 | 97 | #main_content a { 98 | color: #06C; 99 | text-decoration: none; 100 | } 101 | ul { 102 | margin-top: 13px; 103 | margin-left: 18px; 104 | padding-left: 0; 105 | } 106 | ul li { 107 | margin-left: 18px; 108 | padding-left: 0; 109 | } 110 | #lpanel { 111 | width: 620px; 112 | float: left; 113 | } 114 | #rpanel ul { 115 | list-style-type: none; 116 | width: 300px; 117 | } 118 | #rpanel ul li { 119 | line-height: 1.8em; 120 | } 121 | #rpanel { 122 | background: #e7e7e7; 123 | width: 360px; 124 | float: right; 125 | } 126 | 127 | #rpanel div { 128 | width: 300px; 129 | } 130 | -------------------------------------------------------------------------------- /src/Template/template.pkgdef: -------------------------------------------------------------------------------- 1 | [$RootKey$\TemplateEngine\Templates\D3AC7DFF-ED49-45BF-B102-94B150A8867C] 2 | "InstalledPath"="$PackageFolder$" -------------------------------------------------------------------------------- /src/Template/template/templatepack.Template.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | $(MSBuildThisFileFullPath).props 4 | 5 | 6 | 8 | 9 | 10 | Your name here 11 | A description for your template pack 12 | 1.0.0 13 | 14 | 15 | 16 | netstandard1.0 17 | Template 18 | $(MSBuildThisFileDirectory) 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | True 36 | False 37 | False 38 | True 39 | $(MSBuildProjectFullPath) 40 | bin/$(Configuration)/templates/ 41 | 42 | 43 | 44 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | --------------------------------------------------------------------------------