Made the LocalDatabase constructor protected to ensure that derived classes won't call the obsolete warning throwing constructor.

This commit is contained in:
Carl Johnsen
2025-05-19 06:40:18 +02:00
parent 32b14908dd
commit cb4e9eb657
2 changed files with 1 additions and 3 deletions
@@ -90,7 +90,7 @@ namespace Duplicati.Library.Main.Database
public bool ShouldCloseConnection { get; set; }
// Constructor is private to force use of CreateLocalDatabaseAsync
private LocalDatabase() { }
protected LocalDatabase() { }
// Arguments are not used, but are required to match the constructor signatures
[Obsolete("Calling the constructor will throw an exception. Use the CreateLocalDatabaseAsync or CreateLocalDatabase functions instead")]
@@ -59,8 +59,6 @@ namespace Duplicati.Library.Main.Database
public DateTime RestoreTime { get { return m_restoreTime; } }
private LocalRestoreDatabase() { }
public static async Task<LocalRestoreDatabase> CreateAsync(string path, long pagecachesize)
{
var db = new LocalRestoreDatabase();