How do I upgrade following code to Structuremap 4.
This code in one of the Registry inherited class where I don't get Container instance to replace ObjectFactory.GetNamedInstance
public class DI:Registry
{
public DI(){
For<IloanFactory>().Use((loantype) =>
{
switch(loantype)
{
case "home":
return ObjectFactory.GetNamedInstance<ILoan>("regularhome")
case "car":
return ObjectFactory.GetNamedInstance<ILoan>("regularcar")
......
}
});
}
}