コード例 #1
0
        public OrientDBBinaryConnection(string hostname, string username, string password, IOrientDBRecordSerializer <byte[]> serializer, ILogger logger, int port = 2424, int poolsize = 10)
        {
            if (string.IsNullOrWhiteSpace(hostname))
            {
                throw new ArgumentException($"{nameof(hostname)} cannot be null or zero length.");
            }
            if (string.IsNullOrWhiteSpace(username))
            {
                throw new ArgumentException($"{nameof(username)} cannot be null or zero length.");
            }
            if (string.IsNullOrWhiteSpace(password))
            {
                throw new ArgumentException($"{nameof(password)} cannot be null or zero length.");
            }
            _logger    = logger ?? throw new ArgumentNullException($"{nameof(logger)} cannot be null.");
            _serialier = serializer ?? throw new ArgumentNullException($"{nameof(serializer)} cannot be null.");

            _connectionOptions = new DatabaseConnectionOptions
            {
                HostName = hostname,
                Password = password,
                PoolSize = poolsize,
                Port     = port,
                UserName = username
            };

            Open();
        }
コード例 #2
0
        public OrientDBBinaryConnection(DatabaseConnectionOptions options, IOrientDBRecordSerializer <byte[]> serializer, ILogger logger)
        {
            _connectionOptions = options ?? throw new ArgumentNullException($"{nameof(options)} cannot be null.");
            _serialier         = serializer ?? throw new ArgumentNullException($"{nameof(serializer)} cannot be null.");
            _logger            = logger ?? throw new ArgumentNullException($"{nameof(logger)} cannot be null.");
            _payloadFactory    = new CommandPayloadConstructorFactory(logger);

            Open();
        }