Async injection
summary
Claims a way to combine dependency injection with async/await without leaking async into domain code by treating async as a monad and moving impure operations to the system boundary. Shows C# code (Task, Lazy<T>, custom Maybe<T> monad, repository and HTTP controller), uses Select/SelectMany flattening and a match (aggregate) to avoid pulling values out, refactors a reservation system so domain logic stays synchronous and the async work stays at the edge, and demonstrates it compiles and runs.
AI-written summary · about
chapters (21)
- 0:00Start
- 1:25How Do I Combine Dependency Injection with a Sink and a Weight without Leaky Abstractions
- 1:44Code Example
- 2:39Domain Logic
- 7:23Change the Return Types
- 9:30Final Changes
- 11:29How Do I Get the Value out of My Monad
- 12:13Zen and the Art of Motorcycle Maintenance
- 15:11Functor
- 15:59The Structure Preserving Map
- 16:34Structure Preserving Map
- 19:49Unit Containers
- 23:31Query Syntax
- 24:42What a Monad Is
- 40:33Aggregate Method
- 42:50How To Combine Dependency Injection with Async and a Weight without Leaky Abstractions
- 43:57Impure Operation
- 44:13Impure Operations
- 45:26Create Method
- 55:00Compiler Warning
- 57:54Clean Up the Code








