JiShe.CollectBus/shared/JiShe.CollectBus.Domain.Shared/Interceptors/ProtocolInspectInterceptorRegistrar.cs
2025-04-17 20:28:50 +08:00

25 lines
705 B
C#

using Microsoft.Extensions.Options;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.DynamicProxy;
namespace JiShe.CollectBus.Interceptors
{
public static class ProtocolInspectInterceptorRegistrar
{
public static void RegisterIfNeeded(IOnServiceRegistredContext context)
{
if (context.ImplementationType.GetMethods().Any(a=>a.IsDefined(typeof(ProtocolInspectAttribute), true)))
{
context.Interceptors.TryAdd<ProtocolInspectInterceptor>();
}
}
}
}