~/talk

.NET Core Dependency Injection – The Booster Jab

Talkat NDC London 2021 · 2021-01-25..01-29· [developer-experience]
links:none on file
slides:none on file

Covers concrete pitfalls and workarounds for the built‑in Microsoft DI: singleton constructors can capture scoped or transient instances and leak them for app lifetime; middleware singletons resolve scoped services from the root provider; use UseServiceProviderFactory to plug in Autofac and ConfigureContainer for its modules; emulate named/key resolution with a string→implementation delegate (example: temperature converters) and use custom delegates for testable DateTime. Shows factory/builder patterns, Scrutor assembly scanning, IHostApplicationLifetime for disposing hand‑created instances, and a hosted warm‑up service to improve startup JIT and singleton readiness.

AI-written summary · about

  1. 0:00Introduction
  2. 7:02Lifetimes
  3. 14:13Scope
  4. 25:00registration
  5. 27:44hints and tricks
  6. 34:18design patterns
  7. 41:18runtime error
  8. 41:50value types
  9. 42:13record types
  10. 42:57custom delegates
  11. 46:07delegate example
  12. 46:50antipattern
  13. 47:49example
  14. 48:12delegate
  15. 49:03consumer
  16. 49:35decorator
  17. 51:19registration services
  18. 52:18performance
  19. 53:19wrap up
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.