fix: fix incorrect path to database file

This commit is contained in:
cuqmbr 2022-08-22 15:15:40 +03:00
parent c88e7fb359
commit bc70d9e9de

View File

@ -14,14 +14,12 @@ public sealed class DatabaseContext : DbContext
public DatabaseContext(string dbName = "netxml2kml.sqlite3.db")
{
var path = Path.Join(RuntimeStorage.AppFolder, "netxml2kml");
if (!Directory.Exists(path))
if (!Directory.Exists(RuntimeStorage.AppFolder))
{
Directory.CreateDirectory(path);
Directory.CreateDirectory(RuntimeStorage.AppFolder);
}
DbPath = Path.Join(path, dbName);
DbPath = Path.Join(RuntimeStorage.AppFolder, dbName);
Database.EnsureCreated();
}