Async injection
summary
Shows how to keep domain code synchronous while IO stays async by moving impure operations to the boundary, refactoring nullable returns into a composable Maybe<T> (Option), and treating async operations as a Task monad with Select/SelectMany to flatten nested tasks. Code examples in C# replace null checks with match/aggregate, map reservations to creates at the boundary, and let core logic remain deterministic. The pattern—called behavior injection—compiles, runs, and avoids leaking async into domain interfaces.
AI-written summary · about
chapters (16)
- 0:00Start
- 2:39Business Logic
- 3:01Method Signature
- 4:01Constructor Injection
- 7:23The Dependency Inversion Principle
- 11:57How Do I Get the Value of My Monad
- 16:14Structure Preserving Map
- 22:49Query Syntax
- 28:29Semi Containers
- 32:15Constructor Overload
- 32:44Add a Select Method
- 41:01How Do I Combine Dependency Injection with Async and a Weight without Leaky Abstraction
- 44:59Dependency Injection
- 45:48Repository Create
- 48:17Change the Post Method
- 51:28Compiler Warning








