Beispiel #1
0
        public void UoWCreateInEachManager()
        {
            var mgrAreaType = IoC.Instance.Resolve <IBaseManager <AreaType> >();
            var mgrMandant  = new MandantManager();

            mgrAreaType.GetAll();
            mgrMandant.GetAll();
        }
Beispiel #2
0
        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();
            }
        }