{"id":37037103,"url":"https://github.com/agutak/aspnet-onion-template","last_synced_at":"2026-01-14T04:24:51.746Z","repository":{"id":45804993,"uuid":"514599250","full_name":"agutak/aspnet-onion-template","owner":"agutak","description":"ASP.NET Onion Architecture Solution Template","archived":false,"fork":false,"pushed_at":"2024-05-28T18:18:57.000Z","size":281,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-11-06T21:15:38.335Z","etag":null,"topics":["asp-net","csharp","dotnet","dotnet6","dotnet7","dotnet8","entity-framework-core","mongodb","mssql","net8","onion-architecture","template"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agutak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-16T14:24:07.000Z","updated_at":"2024-05-09T18:16:26.000Z","dependencies_parsed_at":"2023-09-22T11:21:59.932Z","dependency_job_id":"4e46e2f8-b291-47e0-8d15-44377bbed3d6","html_url":"https://github.com/agutak/aspnet-onion-template","commit_stats":{"total_commits":94,"total_committers":4,"mean_commits":23.5,"dds":0.276595744680851,"last_synced_commit":"2bf4dd54c68c3e0d7ec92acd94fdaf2f3c78f12d"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/agutak/aspnet-onion-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agutak%2Faspnet-onion-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agutak%2Faspnet-onion-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agutak%2Faspnet-onion-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agutak%2Faspnet-onion-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agutak","download_url":"https://codeload.github.com/agutak/aspnet-onion-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agutak%2Faspnet-onion-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28409486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asp-net","csharp","dotnet","dotnet6","dotnet7","dotnet8","entity-framework-core","mongodb","mssql","net8","onion-architecture","template"],"created_at":"2026-01-14T04:24:51.043Z","updated_at":"2026-01-14T04:24:51.739Z","avatar_url":"https://github.com/agutak.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![icon](https://raw.githubusercontent.com/agutak/aspnet-onion-template/master/.github/icon.png) ASP.NET Onion Architecture Solution Template\n[![CodeQL](https://github.com/agutak/aspnet-clean-template/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/agutak/aspnet-clean-template/actions/workflows/codeql-analysis.yml)\n[![Nuget](https://img.shields.io/nuget/vpre/AHutak.OnionArchitecture.AspNet?label=NuGet)](https://www.nuget.org/packages/AHutak.OnionArchitecture.AspNet)\n[![Nuget](https://img.shields.io/nuget/dt/AHutak.OnionArchitecture.AspNet?label=Downloads)](https://www.nuget.org/packages/AHutak.OnionArchitecture.AspNet)\n\n## Template Description\nThis is a template package with two solution templates:\n- ASP.NET Web API application,\n- gRPC application.\n\nBoth of these solutions are built according to the Onion Architecture.\n\nYou can create a new solution based on one of these templates by installing the associated NuGet package and using it from Visual Studio 2022 and later or directly with DotNet CLI commands.\n\nEach template contains:\n- Domain, Application, Persistence, Infrastructure, and API projects,\n- MS SQL and MongoDB persistence layer implementations which the user can choose during solution creation,\n- Optional Entity Framework migrations project,\n- Unit tests and Component tests template projects,\n\nThe template of your choice contains either:\n- API project with REST minimal APIs and, optionally, standard controllers\n- API project with gRPC service\n\n## Getting Started\n\n### Building nuget package from source code\n\nTo build the NuGet package from the source code follow the next steps:\n- [install nuget.exe](https://learn.microsoft.com/en-us/nuget/install-nuget-client-tools?tabs=windows#install-nugetexe)\n- run nuget pack command from the root of the repository\n\n  ``` nuget pack aspnet-onion-template.nuspec -NoDefaultExcludes ```\n\n### Installing the templates\n\nTo install this package on your system from a NuGet package stored at nuget.org run the following command with the latest package version\n\n``` dotnet new --install AHutak.OnionArchitecture.AspNet::\u003clatest version\u003e ```\n\nTo install this package on your system from a local nupkg file run the following command with the latest package version\n\n``` dotnet new install \u003cPATH_TO_NUPKG_FILE\u003e/AHutak.OnionArchitecture.AspNet.\u003clatest version\u003e.nupkg ```\n\nFor more information see [Installing a template package.](https://learn.microsoft.com/en-us/dotnet/core/tools/custom-templates#install-a-template-package)\n\nYou should see the message shown below which indicates a successful installation\n\n![image](https://user-images.githubusercontent.com/25172188/208269429-cd8faa56-255d-4019-8839-5a8f80ffd918.png)\n\nAfter that you have several options, to use it either from Visual Studio 2022 or from the command line.  \n\n#### From Visual Studio 2022:\n\n![image](https://user-images.githubusercontent.com/25172188/208269465-dec81650-9cac-4f20-af2f-cf03b1377ce0.png)\n\n![image](https://user-images.githubusercontent.com/25172188/182181727-e2fda348-8eca-4dad-8bdd-479b0e7cf428.png)\n\n#### From command-line:\n\n``` dotnet new oa-sln-aspnet-grpc -n Your-Project-Name ```\n\nor\n\n``` dotnet new oa-sln-aspnet-webapi -n Your-Project-Name ```\n\nTo view other available command-line solution parameters please run\n\n``` dotnet new oa-sln-aspnet-grpc --help ```\n\nor\n\n``` dotnet new oa-sln-aspnet-webapi --help ```\n\nAt the moment these templates support two persistence layer implementations: \n- MS SQL with EF Core\n- MongoDB.\n\nYou can select one of them during solution creation.\n\n### Launching the solution\n\nThe next step to launch the newly created solution is updating the appsettings json files in the API project.  \nYou will need to provide the database connection information.  \nDepending on the selected Persistence layer implementation appsettings json files will contain one of the configuration sections:\n\n- for MongoDB\n\n``` \n  \"MongoDbSettings\": {\n    \"ConnectionString\": \"\",\n    \"DatabaseName\": \"\"\n  }\n```\n\n- for MS SQL\n``` \n  \"ConnectionStrings\": {\n    \"MyDbConnectionString\": \"\"\n  }\n```\n\nIf MS SQL persistence implementation was selected during solution creation you have to run migrations on your database.\nThis step can be done with the following commands run from the root directory of your solution (assuming you have installed the \"dotnet ef\" tools)\n\n``` \n  dotnet ef database update -p src/your-solution-name.Persistence.MsSql.Migrations/ -s src/your-solution-name.Persistence.MsSql.Migrations/ --connection 'your-connection-string' \n```\n\nFor more information on Entity Framework Core tools see [Entity Framework Core tools reference](https://docs.microsoft.com/en-us/ef/core/cli/dotnet)\n\n\nAfter that, you can launch the API project from Visual Studio or the command line.\n\n## Support\n\nIf you are having problems, please let us know by [raising a new issue](https://github.com/agutak/aspnet-onion-template/issues/new/choose).\n\n## License\n\nThis project is licensed with the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagutak%2Faspnet-onion-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagutak%2Faspnet-onion-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagutak%2Faspnet-onion-template/lists"}