I use Unity with MVC and NHibernate. Unfortunately, our UnitOfWork is located in a different .dll and does not have an empty .ctor. This is what I do to register NHibernate:
var connectionString = ConfigurationManager.ConnectionStrings
["jobManagerConnection"].ConnectionString;
var assemblyMap = ConfigurationManager.AppSettings["assemblyMap"];
container.RegisterType<IUnitOfWork, UnitOfWork>(
new ContainerControlledLifetimeManager());
In my WebController, I have this:
[Dependency]
public IUnitOfWork UnitOfWork { get; set; }
The problem is that the UnitOfWork constructor expects 2 required rows. How can I configure RegisterType for this interface to pass two parameters obtained from web.config? Is it possible?
source
share