Is it possible in LightInject IoC to resolve a type based on some custom method?
eg the resolver would call a method like this
public interface IMyType {}
public class MyEvenType : IMyType {}
public class MyOddType : IMyType {}
public static int Foo;
public static IMyType ResolveType()
{
if (Foo % 2 == 0)
return MyEvenType;
return MyOddType;
}
How would I write the container.Register
method so that it calls the above method in order to resolve the dependency?