Exemple #1
0
        /// <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;
        }
Exemple #2
0
        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;
        }