19 using System.Collections.Generic;
39 throw new ArgumentNullException(
"database");
42 sessions =
new List<ISession>();
60 return sessions.Any(x => x.User.Name == userName);
73 return sessions.Count;
89 return sessions[index];
102 return sessions.GetEnumerator();
106 IEnumerator IEnumerable.GetEnumerator() {
107 return GetEnumerator();
112 if (sessions.Contains(session))
115 sessions.Add(session);
122 sessions.Remove(session);
readonly List< ISession > sessions
The default implementation of a database in a system.
The representation of a single database in the system.
Manages all the open sessions towards a single database within as system.
An isolated session to a given database for a given user, encapsulating the transaction for operation...
bool Add(ISession session)
void Remove(ISession session)
bool IsUserActive(string userName)
Determines whether the specific user is active.
IEnumerator< ISession > GetEnumerator()
Returns an enumerator that iterates through the collection.
ActiveSessionList(IDatabase database)
Initializes a new instance of the ActiveSessionList class that is wrapped around a given database con...