This commit is contained in:
TheXamlGuy
2024-05-04 15:13:46 +01:00
parent 800aede07b
commit 7cbca0783f
36 changed files with 378 additions and 159 deletions
+16 -3
View File
@@ -2,12 +2,25 @@
namespace Bitvault;
public class VaultDbContext: DbContext
public class VaultDbContext(DbContextOptions<VaultDbContext> options) :
DbContext(options)
{
public DbSet<Category> Categories { get; set; }
public DbSet<Document> Documents { get; set; }
public DbSet<Locker> Lockers { get; set; }
public VaultDbContext(DbContextOptions<VaultDbContext> options): base(options)
{
public DbSet<Tag> Tags { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Locker>()
.HasMany(x => x.Tags)
.WithOne();
modelBuilder.Entity<Locker>()
.HasMany(x => x.Documents)
.WithOne();
}
}