/// <summary> /// Default constructor /// </summary> /// <param name="options">Options for LDAP communication</param> /// <param name="log"></param> public LDAPSession(IOptions <LDAPConfiguration> options, ILogger <LDAPSession> log) { // Sessions start closed _state = LDAPSessionState.Closed; _options = options.Value; _connection = new LDAPConnection(_options.IsSecured, log); _log = log; }
void Dispose(bool disposing) { // Check state flags if (disposing && !_isDisposed) { // Ensure we cleanup connection resources if (_connection != null) { _connection.Dispose(); } _connection = null; // Notify GC to ignore GC.SuppressFinalize(this); } _isDisposed = true; }