With Simple Injector, you will just have to either:
- Register a Func delegate explicitly using
Register<Func<A, B, C>>((a, b) => { ... })
- Create an interface such as
ILoggerFactory
, creste an implementation and register them.
UPDATE
After reading your question again and looking up the definition of Castle's UsingFactoryMethod
I came to the conclusion that I misinterpreted your question. What you are looking for is creating an instance based on its parent type: Context Based Injection.
You can achieve this by implementing the Context Based Injection Extension method that is given as example on the Simple Injector's documentation wiki.
When you add this extension method to your project you can do the equivalent registration as follows:
container.RegisterWithContext<ILogger>(context =>
{
return new Logger(context.ImplementationType.Name);
});