I'm currently extending Orchard with a small module which stores data in the database.
I created data record class, a migration and a controller.
I added the dependency injection to the controller and so I am able to store data in the db.
But now I need to work with the data in a worker role. So I cannot use the dependency injection.
I tried to resolve the dependency but unfortunately only get an error.
var builder = new ContainerBuilder();
var container = builder.Build();
var x = container.Resolve<IRepository<MyRecord>>();
In the line where I try to resolve, I receive the error:
None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Orchard.Data.Repository`1[testModule.Models.MyRecord]' can be invoked with the available services and parameters:
Cannot resolve parameter 'Orchard.Data.ISessionLocator sessionLocator' of constructor 'Void .ctor(Orchard.Data.ISessionLocator)'.
How do I have to resolve that correctly?