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

@@ -9,10 +9,10 @@ namespace Serein.Library.Attributes
[AttributeUsage(AttributeTargets.Property)]
public sealed class AutoInjectionAttribute : Attribute
{
}
}
/// <summary>
/// 表示该类自动注册
/// 表示该类自动注册(单例模式)
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public sealed class AutoRegisterAttribute : Attribute
@@ -20,7 +20,7 @@ namespace Serein.Library.Attributes
}
/// <summary>
/// 用来判断一个类是否需要注册并构建实例(单例模式场景使用)
/// 用来判断一个类是否需要注册并构建节点
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class DynamicFlowAttribute : Attribute