Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses Issue #46997 by improving the dependency injection documentation examples to be more complete and executable. The changes add full code context with namespaces, using statements, and helpful notes about required packages and desktop application lifetime management.
Changes:
- Added explicit using statements and wrapping
<All>snippet tag to Program.cs to show the complete executable example - Created StandaloneWorker.cs to demonstrate the "bad" pattern of hard-coded dependencies
- Added IMPORTANT notes about the Worker SDK requirement and NuGet package dependencies
- Added guidance for desktop app developers about lifetime management integration
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/core/extensions/dependency-injection/snippets/overview/Program.cs | Added using statements and <All> snippet wrapper to show complete executable code |
| docs/core/extensions/dependency-injection/snippets/overview/StandaloneWorker.cs | New file demonstrating hard-coded dependency anti-pattern |
| docs/core/extensions/dependency-injection/overview.md | Added SDK and package notes, updated snippet references to show complete examples |
docs/core/extensions/dependency-injection/snippets/overview/StandaloneWorker.cs
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
gewarren
approved these changes
Feb 27, 2026
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
Fixes #46997
Internal previews