3 ms·
A better take on DI wireups in .NET: https://nblumhardt.com/2010/01/the-relationship-zoo/ https://nblumhardt.com/2010/01/the-relationship-zoo/ The gist:
by rhencke 6y ago
A better take on DI wireups in .NET: https://nblumhardt.com/2010/01/the-relationship-zoo/ https://nblumhardt.com/2010/01/the-relationship-zoo/
The gist:
Relationship Adapter Type Meaning
A needs a B None Dependency
A needs a B at some point in the future Lazy<B> Delayed instantiation
A needs to create instances of B Func<B> Dynamic instantiation
A provides parameters of types X and Y to B Func<X,Y,B> Parameterisation
A needs all the kinds of B IEnumerable<B> Enumeration