Finished database management and user authentication
This commit is contained in:
22
HopFrame.Database/HopDbContextBase.cs
Normal file
22
HopFrame.Database/HopDbContextBase.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using HopFrame.Database.Models.Entries;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace HopFrame.Database;
|
||||
|
||||
public class HopDbContextBase : DbContext {
|
||||
|
||||
public HopDbContextBase() {}
|
||||
|
||||
public HopDbContextBase(DbContextOptions options) : base(options) {}
|
||||
|
||||
public virtual DbSet<UserEntry> Users { get; set; }
|
||||
public virtual DbSet<PermissionEntry> Permissions { get; set; }
|
||||
public virtual DbSet<TokenEntry> Tokens { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder) {
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
modelBuilder.Entity<UserEntry>();
|
||||
modelBuilder.Entity<PermissionEntry>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user