Files
serein-flow/Library/Attributes/AutoInjectionAttribute.cs
fengjiayi 8dc7f5dd9b 调整了Library文件结构;
源代码生成新增了参数验证方法;
修改了ParamterDetails的定义
2025-07-29 18:36:43 +08:00

18 lines
861 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
namespace Serein.Library
{
/// <summary>
/// <para>表示该属性为自动注入依赖项。</para>
/// <para>使用场景:构造函数中存在互相依赖的情况</para>
/// <para>例如ServiceA类构造函数中需要传入ServiceBServiceB类构造函数中也需要传入ServiceA</para>
/// <para>这种情况会导致流程启动时IOC容器无法注入构造函数并创建类型导致启动失败。</para>
/// <para>解决方法从ServiceA类的构造函数中移除ServiceB类型的入参将该类型更改为公开可见的可写属性成员ServiceB serviceB{get;set;},并在该属性上标记[AutoInjection]特性</para>
/// </summary>
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public sealed class AutoInjectionAttribute : Attribute
{
}
}