~/talk

It depends: .NET Core dependency injection

Talkat Riga Dev Days 2019 · 2019-05-29..05-31· [dotnet]
slides:none on file

Default .NET Core DI is wired into apps so a bare ASP.NET Core 3.0 project already registers 265 registrations and uses constructor injection with three lifetimes singleton scoped transient. Background workers must create scopes with IServiceScopeFactory or singletons resolve transients into the root provider and cause memory leaks. Custom containers plug in via IServiceProviderFactory or by returning an IServiceProvider from ConfigureServices. Enable runtime checks like ValidateOnBuild or ValidateScopes to catch circular dependencies and invalid lifetime mixes before they hit production.

AI-written summary · about

  1. 0:00Intro
  2. 1:45Why do you need dependency injection?
  3. 4:54Dependency injection at work
  4. 12:57Registering and mapping service types
  5. 14:49Lifetime of resolved objects
  6. 16:37Startup dass Typical startup in ASPNET Core
  7. 25:46Hosting in .NET Core 3.0 Hosting outside and without ASPNET Core
  8. 36:47Custom service providers
  9. 43:18Convention based startup Different regstrations for environments
  10. 45:22Validation of scopes
~/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.