using Microsoft.Extensions.DependencyInjection;
using System;
namespace FastGithub
{
///
/// 表示服务特性
///
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
public sealed class ServiceAttribute : Attribute
{
///
/// 获取服务的生命周期
///
public ServiceLifetime Lifetime { get; }
///
/// 获取或设置注册的服务类型
/// 为null直接使得当前类型
///
public Type? ServiceType { get; set; }
///
/// 将当前实现类型注册为服务的特性
///
/// 生命周期
public ServiceAttribute(ServiceLifetime lifetime)
{
Lifetime = lifetime;
}
}
}