Blog.Core/Blog.Core.EventBus/EventBusSubscriptions/SubscriptionInfo.cs

30 lines
694 B
C#
Raw Normal View History

2020-11-18 23:34:59 +08:00
using System;
namespace Blog.Core.EventBus
2020-11-18 23:34:59 +08:00
{
2020-11-20 19:19:01 +08:00
/// <summary>
/// 订阅信息模型
/// </summary>
2020-11-18 23:34:59 +08:00
public class SubscriptionInfo
{
public bool IsDynamic { get; }
public Type HandlerType { get; }
private SubscriptionInfo(bool isDynamic, Type handlerType)
{
IsDynamic = isDynamic;
HandlerType = handlerType;
}
public static SubscriptionInfo Dynamic(Type handlerType)
{
return new SubscriptionInfo(true, handlerType);
}
public static SubscriptionInfo Typed(Type handlerType)
{
return new SubscriptionInfo(false, handlerType);
}
}
}