Dependency Injection Lifetimes
“Hey Framework! Any time this API endpoint is called and we create an object that is a SomeController that needs an IDoThingsService, create a brand new DoThingsThisWayService and use that. When the SomeController object gets destroyed, keep the IDoThingsService we created until we’re done with the API request in case something else needs it during this scope. Once we’re done with the API request, then destroy the IDoThingsService.”