public DatabaseConfiguration Serializer(IDatabaseRecordParser <TDataType> parser)
 {
     if (parser == null)
     {
         throw new ArgumentNullException($"{nameof(parser)} cannot be null.");
     }
     _addParser(parser);
     return(_configuration);
 }
        internal ArangoDBConnection(IDatabaseRecordParser <TDataType> parser, IDatabaseConnectionProtocol <TDataType> protocol, ILogger logger, string database)
        {
            if (parser == null)
            {
                throw new ArgumentNullException($"{nameof(parser)}");
            }
            if (protocol == null)
            {
                throw new ArgumentNullException($"{nameof(protocol)}");
            }
            if (string.IsNullOrWhiteSpace(database))
            {
                throw new ArgumentException($"{nameof(database)}");
            }
            _logger = logger ?? throw new ArgumentNullException($"{nameof(logger)}");

            _serverConnection   = protocol.CreateServerConnection(parser, logger);
            _databaseConnection = _serverConnection.Connect(database);
        }
 public IDatabaseServerConnection CreateServerConnection(IDatabaseRecordParser <TDataType> parser, ILogger logger)
 {
     throw new NotImplementedException();
 }
Example #4
0
 internal DatabaseConnectionFactory(IDatabaseConnectionProtocol <TDataType> protocol, IDatabaseRecordParser <TDataType> parser, ILogger logger)
 {
     _connectionProtocol = protocol ?? throw new ArgumentNullException($"{nameof(protocol)} cannot be null.");
     _parser             = parser ?? throw new ArgumentNullException($"{nameof(parser)} cannot be null");
     _logger             = logger ?? throw new ArgumentNullException($"{nameof(logger)} cannot be null");
 }