public void CloseSession(IEnumerable<modelSpiderTestRecord> tRecords) { if (CurrentSession != null) { CurrentSession.CloseSession(tRecords); AddOrUpdate(CurrentSession); } // <---- should be called when session is getting closed }