namespace Admin.NET.Core; /// /// 事件订阅 /// public class AppEventSubscriber : IEventSubscriber, ISingleton { private readonly IServiceProvider _serviceProvider; public AppEventSubscriber(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; } ///// ///// 增加异常日志 ///// ///// ///// //[EventSubscribe("Add:ExLog")] //public async Task CreateExLog(EventHandlerExecutingContext context) //{ // using var scope = _serviceProvider.CreateScope(); // var _rep = scope.ServiceProvider.GetRequiredService>(); // await _rep.InsertAsync((SysLogEx)context.Source.Payload); // // 发送邮件 // await scope.ServiceProvider.GetRequiredService().SendEmail(JSON.Serialize(context.Source.Payload)); //} }