docs: add DI guide for minimal API callbacks#2740
Open
rajan-chari wants to merge 2 commits intomainfrom
Open
Conversation
New in-depth guide covering DI access in callback handlers: - Closure capture pattern for singleton/transient services - CreateScope() for scoped services (DbContext etc.) - Migration note for developers coming from controller pattern - Link from BotBuilder integration migration guide Addresses microsoft/teams.net#420 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The docs generator fails in production mode if language-specific include files are missing. Added languages: [csharp] frontmatter to prevent generation for TypeScript/Python (no DI guide for those yet — they use different patterns). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Verified with a local production build (
|
heyitsaamir
requested changes
Apr 10, 2026
| @@ -0,0 +1,80 @@ | |||
| <!-- accessing-services --> | |||
Collaborator
There was a problem hiding this comment.
This will lead to blank pages in other languages I think
Collaborator
There was a problem hiding this comment.
and rendered error messages. Can use N/A under sections and missing-pages.json file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prompted by microsoft/teams.net#420 — a real user question about accessing DI services in the callback pattern.
Files changed
in-depth-guides/dependency-injection/csharp.incl.mdin-depth-guides/dependency-injection.mdxmigrations/botbuilder/integration/csharp.incl.md🤖 Generated with Claude Code