Should I use Unity Config file or Code to register types and instances?
问题 Finally started to configure an IoC Container! I'm using Unity and have configured it to have my objects registered using the config file: e.g. <container> <register type="ILogger" mapTo="Logger"> <lifetime type="singleton"/> </register> <register type="IPdfWriter" mapTo="PdfWriter"> <lifetime type="perthread" /> <constructor /> </register> </container> I've reached a point where I doubt this is a good approach to register types. For example a class of mine is dependent on the ICacheManager