You only need RegisterGeneric
if you also have a generic interface.
In your case you only have a non generic interface IUnitOfWork
and also only one DbContext
derived class so you can just register your UnitOfWork<Context>
as a normal type with:
builder.RegisterType<UnitOfWork<Context>>()
.As<IUnitOfWork>().InstancePerHttpRequest();
So any of your types requesting an IUnitOfWork
will get an UnitOfWork<Context>
.