Skip to content

docs: add DI guide for minimal API callbacks#2740

Open
rajan-chari wants to merge 2 commits intomainfrom
docs/di-guide
Open

docs: add DI guide for minimal API callbacks#2740
rajan-chari wants to merge 2 commits intomainfrom
docs/di-guide

Conversation

@rajan-chari
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a new in-depth guide for dependency injection in minimal API callback handlers
  • Covers closure capture pattern, scoped services (CreateScope), and migration from controllers
  • Adds DI callout to the BotBuilder integration migration guide

Prompted by microsoft/teams.net#420 — a real user question about accessing DI services in the callback pattern.

Files changed

Action File
New in-depth-guides/dependency-injection/csharp.incl.md
New in-depth-guides/dependency-injection.mdx
Modified migrations/botbuilder/integration/csharp.incl.md

🤖 Generated with Claude Code

rajan-chari and others added 2 commits April 10, 2026 12:56
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>
@rajan-chari rajan-chari marked this pull request as ready for review April 10, 2026 18:32
@rajan-chari
Copy link
Copy Markdown
Collaborator Author

Verified with a local production build (NODE_ENV=production npm run generate:docs):

  • 0 content gapslanguages: [csharp] frontmatter correctly restricts generation to C# only
  • 65 templates generated for all 3 languages — no regressions
  • Generated output confirmed at docs/main/csharp/in-depth-guides/dependency-injection.mdx
  • TypeScript and Python correctly skipped (no include files for those languages yet)

@@ -0,0 +1,80 @@
<!-- accessing-services -->
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will lead to blank pages in other languages I think

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and rendered error messages. Can use N/A under sections and missing-pages.json file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants