public Database() { _dbFullName = Path.Combine(Globals.DbDir, DbName); _dbExistsOnFs = File.Exists(Path.Combine(_dbFullName)) ? DbExistsOnFileSystem.True : DbExistsOnFileSystem.False; }
public void Create() { if (File.Exists(_dbFullName)) { throw new InvalidOperationException( $"Cannot create {_dbFullName} because it already exists."); } if (!Directory.Exists(Globals.DbDir)) { Directory.CreateDirectory(Globals.DbDir); } using (var temp = File.Create(_dbFullName)){} _dbExistsOnFs = DbExistsOnFileSystem.True; Console.WriteLine($"Created datatabase: {_dbFullName}"); }