docs icon indicating copy to clipboard operation
docs copied to clipboard

docs: clarify thread safety of service resolution in .NET dependency …

Open abhiramch018 opened this issue 2 weeks ago • 2 comments

…injection

Summary

Clarified that resolving services from the built-in .NET dependency injection (DI) container is thread-safe.

Changes

  • Updated the Thread safety section in dependency-injection-guidelines.md.
  • Added explicit statement that:
    • Service resolution via IServiceProvider and IServiceScope is thread-safe.
    • Service implementations themselves must still handle internal concurrency.
  • Added a note block for clarity.

Motivation

Resolves issue #47086 by explicitly documenting DI service resolution thread safety, which was previously implied but not stated.

Summary

Describe your changes here.

Fixes #Issue_Number (if available)


Internal previews

📄 File 🔗 Preview link
docs/core/extensions/dependency-injection-guidelines.md Dependency injection guidelines

abhiramch018 avatar Nov 25 '25 12:11 abhiramch018