mirror of
https://github.com/techgarage-ir/MTWireGuard.git
synced 2025-08-30 06:39:27 +02:00
Update application core
This commit is contained in:
parent
6655664ed6
commit
c118242c5b
5 changed files with 474 additions and 27 deletions
|
@ -1,4 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using MTWireGuard.Application.Models;
|
||||
using MTWireGuard.Application.Models.Mikrotik;
|
||||
|
||||
namespace MTWireGuard.Application
|
||||
|
@ -6,6 +7,9 @@ namespace MTWireGuard.Application
|
|||
public class DBContext : DbContext
|
||||
{
|
||||
public DbSet<WGPeerDBModel> Users { get; set; }
|
||||
public DbSet<WGServerDBModel> Servers { get; set; }
|
||||
public DbSet<DataUsage> DataUsages { get; set; }
|
||||
public DbSet<LastKnownTraffic> LastKnownTraffic { get; set; }
|
||||
|
||||
public string DbPath { get; }
|
||||
|
||||
|
@ -15,7 +19,11 @@ namespace MTWireGuard.Application
|
|||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
||||
=> options.UseSqlite($"Data Source={DbPath}");
|
||||
{
|
||||
options.UseSqlite($"Data Source={DbPath}", opt =>
|
||||
{
|
||||
opt.MigrationsAssembly("MTWireGuard.Application");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue