Does Light Inject allow you to pass parameters to constructor when you resolve? I\'d like to know if both these frameworks do what Unity\'s ResolverOverride or DependencyOve
Probably the easiest option with Simple Injector is to register with a delegate
[Test]
public void Test1()
{
Container container = new Container();
container.Register(() => new ClassWithParameter("SomeValue"));
var result = container.GetInstance();
}
public interface IClassWithParameter { }
public class ClassWithParameter : IClassWithParameter
{
public ClassWithParameter(string parameter)
{
}
}
An advanced option for injecting primitive dependencies is detailed here