public UnitOfWork(UnitOfWorkOption option) { list = new List <OperatorInfo>(); Maplist = new List <Map>(); this.isShadow = false; this.Option = option; if (this.Option == UnitOfWorkOption.Required) { UnitOfWork currentUnitOfWork = GetCurrentUnitOfWork(); if (currentUnitOfWork == null) { this.list = new List <OperatorInfo>(); } else { this.list = currentUnitOfWork.list; this.isShadow = true; } } UnitOfWorkStack.Push(this); }
public UnitOfWork(UnitOfWorkOption option) { _list = new List <OperatorInfo>(); _maplist = new List <Map>(); _isShadow = false; Option = option; if (Option == UnitOfWorkOption.Required) { var currentUnitOfWork = GetCurrentUnitOfWork(); if (currentUnitOfWork == null) { _list = new List <OperatorInfo>(); } else { _list = currentUnitOfWork._list; _isShadow = true; } } UnitOfWorkStack.Push(this); }
public void SetCurrentUnitOfWork(UnitOfWork unitOfWork) { UnitOfWorkStack.Push(unitOfWork); }