using System;
namespace Falcon.DI
{
///
/// 自动注册服务特性。如果要注册到特定服务可以指定,否则注册到所有实现的接口和基类,如果未实现任何接口注册到类型本身。
///
[AttributeUsage(AttributeTargets.Class)]
public class FalconDIRegisterAttribute:Attribute
{
///
/// 默认注册到所有实现的基础接口
///
public FalconDIRegisterAttribute() { }
///
/// 注册到提供的服务类型
///
/// 服务类型
public FalconDIRegisterAttribute(params Type[] type) => this.ServiceTypes = type;
///
/// 注册的服务类型集合
///
public Type[] ServiceTypes { get; set; } = null;
///
/// 生命周期
///
public ServiceLifetime Lifetime { get; set; } = ServiceLifetime.Scoped;
}
}