From Zero to Hero: Dependency Injection in .NET

From Zero to Hero: Dependency Injection in .NET

English | MP4 | AVC 1920×1080 | AAC 44KHz 2ch | 77 Lessons (4h 41m) | 1.12 GB

Master one of .NET’s core pillars
It is not an exaggeration to say that Dependency Injection is one of the core pillars of building modern .NET applications. It allows us to write cleaner code, both in structure but also in testability. There is a reason why since .NET Core launched (now simply .NET), it has been part of the framework and part of every codebase that is using it. It is a skill that every single .NET developer needs to master, and in this course, Nick will show you how to do just that.

Table of Contents

1 Welcome
2 What will you learn in this course
3 Who is this course for and prerequisites
4 The problem with dependencies
5 Why Dependency injection is necessary
6 A practical example of the dependency problem
7 A less obvious example of a Dependency Injection use-case
8 Dependency injection benefits past testability
9 Injecting Classes vs Abstract classes vs Interfaces
10 So do you have to do all that manually
11 Section recap
12 Section
13 The simplest setup with Dependency Injection
14 The ServiceCollection
15 The ServiceProvider
16 All of the above, in an API
17 The different types of dependency lifetimes
18 The Transient lifetime
19 The Singleton lifetime
20 The Scoped lifetime
21 GetService vs GetRequiredService
22 Generic-based registration vs implementation-based registration
23 Registration approaches
24 The Startup.cs and changes after .NET 6
25 Third party libraries
26 Section recap (2)
27 Resolving dependencies in different project types
28 Resolving dependencies from the constructor
29 Resolving dependencies from the method
30 Resolving dependencies in a console setup
31 Resolving dependencies from the HttpContext
32 Resolving dependencies from Action Filters as Attributes
33 Resolving dependencies from Service Filters
34 Resolving dependencies from Middleware
35 Resolving dependencies in Minimal APIs
36 Resolving dependencies in Razor Views & Pages
37 Resolving dependencies in Blazor
38 Resolving dependencies in gRPC Services
39 Resolving dependencies in Hosted Services
40 Resolving dependencies in service registration
41 Section recap (3)
42 Do you need an interface for everything
43 Choosing the right dependency lifetime
44 Dependency resolving issues and limitations
45 Registering open generics
46 Registering multiple interface implementations
47 The ServiceDescriptor
48 Add vs TryAdd
49 TryAddEnumerable
50 Replacing dependencies
51 Cleaning up service registration
52 Section recap (4)
53 Creating a custom scope
54 The service locator anti-pattern
55 When service locator makes sense
56 Avoiding capturing dependencies
57 Avoiding multiple service providers
58 Creating decorators
59 The future of dependency injection
60 Section recap (5)
61 What is Scrutor
62 Registering service decorators
63 Surprise optional refactoring lecture
64 Service registration by scanning
65 Interface marking
66 Attribute marking
67 Namespace filtering
68 Using the ServiceDescriptor attribute
69 Using RegistrationStrategies
70 Potential pitfalls
71 Section recap (6)
72 Why should we even bother
73 The design
74 The implementation
75 Extending the main implementation
76 Section recap (7)
77 Course conclusion

Homepage