I have a situation where I would like to resolve a class with a dynamic constructor parameter in my ASP.NET 4, MVC web application. I am using Unity v4.0.1. I need the value that is passed to the constructor of the service on Resolve to be be different for each request as shown below.
var obj = new MyObject();
container.RegisterType<IMyService, MyService>(
new PerRequestLifetimeManager(),
new InjectionConstructor(obj));
How do I achieve this?