I want to register my generic class with its constructor. Like this:
ObjectFactory.Initialize(
action =>
{
action.SelectConstructor<IRepository<>>(() => new Repository<>(LifetimeManager.Current));
});
But I don't how can I do this?
Note: LifetimeManager.Current is static propery. If I don't care about constructor, I can write this, action.For(typeof(IRepository<>)).Use(typeof(Repository<>));
But today I need to give Repository class UnitOfWork parameter via DI.
Thanks.