/// <summary>
 /// Create an instance of the database client.
 /// </summary>
 /// <param name="filename">Sqlite database filename.</param>
 public DatabaseClient(string filename)
 {
     if (String.IsNullOrEmpty(filename))
     {
         throw new ArgumentNullException(nameof(filename));
     }
     _SqliteFilename   = filename;
     _ConnectionString = SqliteHelper.ConnectionString(_SqliteFilename);
 }
Пример #2
0
 /// <summary>
 /// Create an instance of the database client.
 /// </summary>
 /// <param name="settings">Database settings.</param>
 public DatabaseClient(DatabaseSettings settings)
 {
     _Settings = settings ?? throw new ArgumentNullException(nameof(settings));
     if (_Settings.Type != DbTypes.Sqlite)
     {
         throw new ArgumentException("Database settings must be of type 'Sqlite'.");
     }
     _ConnectionString = SqliteHelper.ConnectionString(_Settings);
 }