public virtual TUnitOfWork GetCurrent(int index = 0) { var uow = _registry.GetCurrent(index); if (uow is TUnitOfWork expectedUoW) { return(expectedUoW); } return(default(TUnitOfWork)); }
/// <summary> /// Gets the unit of work in the current scope. /// </summary> public IUnitOfWork GetCurrent() { return(registry.GetCurrent()); }
/// <summary> /// Gets the unit of work in the current scope. /// </summary> public IUnitOfWork GetCurrent(int ancestorLevel = 0) { return(registry.GetCurrent(ancestorLevel)); }