Added modular event system

This commit is contained in:
2025-02-01 11:50:52 +01:00
parent 966ced57d6
commit 39641f18a8
22 changed files with 262 additions and 68 deletions

View File

@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using HopFrame.Core.Events;
using Microsoft.EntityFrameworkCore;
namespace HopFrame.Core.Config;
@@ -7,6 +8,7 @@ public class HopFrameConfig {
public bool DisplayUserInfo { get; set; } = true;
public string? BasePolicy { get; set; }
public string? LoginPageRewrite { get; set; }
public List<HopEventHandler> Handlers { get; } = new();
}
/// <summary>
@@ -38,7 +40,7 @@ public class HopFrameConfigurator(HopFrameConfig config) {
/// <returns>The configurator used for the DbContext</returns>
/// <seealso cref="DbContextConfigurator{TDbContext}"/>
public DbContextConfigurator<TDbContext> AddDbContext<TDbContext>() where TDbContext : DbContext {
var context = new DbContextConfig(typeof(TDbContext));
var context = new DbContextConfig(typeof(TDbContext), InnerConfig);
InnerConfig.Contexts.Add(context);
return new DbContextConfigurator<TDbContext>(context);
}