Answers for "singleton vs transient vs scoped"

2

singleton vs transient vs scoped

SINGLETON: Same object for every controller and request.
SCOPED: Same within a request but different across different requests.
TRANSIENT: Always different. A new instance is created on every controller and every service (can be resource hungry).
Posted by: Guest on July-19-2021
-1

servicecollection addsingleton vs addtransient

//ref https://stackoverflow.com/questions/38138100/addtransient-addscoped-and-addsingleton-services-differences
Posted by: Guest on September-30-2020

Browse Popular Code Answers by Language