public override void RegisterSession(object key, ISession session) { if (parentTransactionScope != null) { parentTransactionScope.RegisterSession(key, session); return; } if (ParentScope != null) { ParentScope.RegisterSession(key, session); } if (!Key2Session.ContainsKey(key)) { Key2Session.Add(key, session); } }
public override ISession GetSession(object key) { if (parentTransactionScope != null) { return(parentTransactionScope.GetSession(key)); } var session = ParentScope == null ? Key2Session[key] : ParentScope.GetSession(key); if (!Key2Session.ContainsKey(key)) { Key2Session.Add(key, session); } Initialize(session); return(session); }