Hi,
Depending on your front end ContainerControlledLifetimeManager is still creates a singleton instance so just take AGBrown's advice above on Lifetime management.
When declaring your Service make sure that you add an Injection Dependency attribute to the constructor arguments so that the correct unit of work is passed in.
i.e.
Toby.
Depending on your front end ContainerControlledLifetimeManager is still creates a singleton instance so just take AGBrown's advice above on Lifetime management.
When declaring your Service make sure that you add an Injection Dependency attribute to the constructor arguments so that the correct unit of work is passed in.
i.e.
public class MyService : Service<DB1ContextRepository>, IMyService
{
public MyServiceDB1(
IRepositoryAsync<DB1ContextRepository> dB1ContextRepository,
[Dependency("DB1Context")] IUnitOfWorkAsync unitOfWork)
{
if (dB1ContextRepository == null) { throw new ArgumentNullException("dB1ContextRepository"); }
if (unitOfWork == null) { throw new ArgumentNullException("unitOfWork"); }
this.dB1ContextRepository = dB1ContextRepository;
this.unitOfWork = unitOfWork;
}
RegardsToby.