public void UoWCreateInEachManager() { var mgrAreaType = IoC.Instance.Resolve <IBaseManager <AreaType> >(); var mgrMandant = new MandantManager(); mgrAreaType.GetAll(); mgrMandant.GetAll(); }
public void UoWCreatedOutsideManager() { var factory = IoC.Instance.Resolve <IUnitOfWorkFactory>(); using (var uow = factory.Create()) { uow.BeginChanges(); var mgrAreaType = IoC.Instance.Resolve <IBaseManager <AreaType> >(); var mgrMandant = new MandantManager(); mgrAreaType.SetUnitOfWork(uow, false); mgrMandant.SetUnitOfWork(uow, false); mgrAreaType.GetAll(); mgrMandant.GetAll(); uow.RollbackChanges(); } }