IOC容器添加构造函数注入(DLL类中使用AutoRegisterAttribute特性标注的类,会在流程启动时自动注册),提高可读性。

This commit is contained in:
fengjiayi
2024-09-30 02:45:49 +08:00
parent 7a310ff1df
commit ccf539b90f
23 changed files with 615 additions and 280 deletions

View File

@@ -27,7 +27,7 @@ namespace Serein.Library.Framework.NodeFlow
{
if(NodeRunCts == null)
{
NodeRunCts = Env.IOC.GetOrRegisterInstantiate<NodeRunCts>();
NodeRunCts = Env.IOC.Get<NodeRunCts>();
}
// 使用局部变量,避免捕获外部的 `action`
Action localAction = action;