{"id":16494352,"url":"https://github.com/james231/minimalapi-withdi","last_synced_at":"2026-05-30T23:31:01.796Z","repository":{"id":119841025,"uuid":"408588397","full_name":"James231/MinimalApi-WithDI","owner":"James231","description":"Example of .NET 6 minimal APIs with Controllers and Dependency Injection","archived":false,"fork":false,"pushed_at":"2021-09-26T15:12:27.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-01T08:17:25.033Z","etag":null,"topics":["api","asp-net-core","csharp","minimal-api"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/James231.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-09-20T20:19:01.000Z","updated_at":"2022-11-15T08:27:05.000Z","dependencies_parsed_at":"2023-06-03T08:15:37.674Z","dependency_job_id":null,"html_url":"https://github.com/James231/MinimalApi-WithDI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/James231/MinimalApi-WithDI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James231%2FMinimalApi-WithDI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James231%2FMinimalApi-WithDI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James231%2FMinimalApi-WithDI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James231%2FMinimalApi-WithDI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/James231","download_url":"https://codeload.github.com/James231/MinimalApi-WithDI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/James231%2FMinimalApi-WithDI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33714033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"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":["api","asp-net-core","csharp","minimal-api"],"created_at":"2024-10-11T14:13:12.116Z","updated_at":"2026-05-30T23:31:01.778Z","avatar_url":"https://github.com/James231.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MinimalApi-WithDI\nExample of .NET 6 ([Preview 7](https://devblogs.microsoft.com/dotnet/announcing-net-6-preview-7/) or later) [Minimal APIs](https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-6-preview-4/#introducing-minimal-apis) with Controllers and Dependency Injection.\n\n## Eh? 🥴\n\nNormally APIs built with ASP.NET include a lot of stuff out-of-the-box, which you might not need. And need a lot of boilerplate code to setup properly.\n\nMinimal APIs added in .NET 6 gives you a barebones project template, with all that missing. You can just write a few simple lines of code to define route mappings to C# methods which return strings.\n\nThis project takes Minimal APIs and adds a bit more. Specifically, I've added Controllers for endpoints, which can be defined using an `[ApiController]` attribute, and dependency injection with equivalent of the usual `ConfigureServices` method.\n\n## Adding Controllers\n\nLook at the `Controllers` folder. Just add them there. Should be obvious.\n\n## Adding Services to DI Container\n\nLook at `Program.cs`, and add your services to `ConfigureServices` at the end.\n\n## Ideas\n- I might replace the reflection code with source generators one day. For nice and speedy startups 🚅\n- Could try using the same codebase for Azure Functions?","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames231%2Fminimalapi-withdi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjames231%2Fminimalapi-withdi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames231%2Fminimalapi-withdi/lists"}