Изменил папку нахождения бд
All checks were successful
Build and deploy / Publish image (push) Successful in 3m5s
All checks were successful
Build and deploy / Publish image (push) Successful in 3m5s
This commit is contained in:
@@ -40,8 +40,12 @@ public class DatabaseContext : DbContext
|
|||||||
|
|
||||||
public DatabaseContext()
|
public DatabaseContext()
|
||||||
{
|
{
|
||||||
var folder = Environment.SpecialFolder.LocalApplicationData;
|
var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||||
DbPath = System.IO.Path.Join("./", "database.db");
|
var folder = Path.Join(baseDirectory, "Data");
|
||||||
|
if (!Directory.Exists(folder))
|
||||||
|
Directory.CreateDirectory(folder);
|
||||||
|
|
||||||
|
DbPath = Path.Join(folder, "database.db");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
||||||
|
|||||||
Reference in New Issue
Block a user