Skip to content

Month: January 2018

Func <T> – Dynamic Instantiation

Think of a scenario where we want more than one instance of a given service, or the decision, whether to instantiate a component is made at run time. For such scenarios injecting a service as a Direct or Lazy dependency will not be enough. However, injecting the service dependency as a Func┬ádo.   Using Func <T> Consider the following example, where we have a PaymentProcessor…