BlackHorizon
BlackHorizon
Explore posts from servers
CC#
Created by BlackHorizon on 8/20/2024 in #help
Autofac: when to use RegiserType with SingleInstance vs RegisterInstance with ExternallyOwned?
For example if I have a global singleton for a Redis cache provider and want to also register it in DI. I could instantiate it then register it with RegisterInstance and ExternallyOwned, or I could use any register method followed by SingleInstance. Which one do you decide is better?
6 replies