Restructured projects and created Services for permissions and users

This commit is contained in:
2024-07-14 12:17:49 +02:00
parent 54ec3b4f52
commit 01978d30ce
19 changed files with 363 additions and 169 deletions

View File

@@ -6,11 +6,7 @@ namespace HopFrame.Database;
/// <summary>
/// This class includes the basic database structure in order for HopFrame to work
/// </summary>
public class HopDbContextBase : DbContext {
public HopDbContextBase() {}
public HopDbContextBase(DbContextOptions options) : base(options) {}
public abstract class HopDbContextBase : DbContext {
public virtual DbSet<UserEntry> Users { get; set; }
public virtual DbSet<PermissionEntry> Permissions { get; set; }
@@ -25,4 +21,12 @@ public class HopDbContextBase : DbContext {
modelBuilder.Entity<TokenEntry>();
modelBuilder.Entity<GroupEntry>();
}
/// <summary>
/// Gets executed when a user is deleted through the IUserService from the
/// HopFrame.Security package. You can override this method to also delete
/// related user specific entries in the database
/// </summary>
/// <param name="user"></param>
public virtual void OnUserDelete(UserEntry user) {}
}