/// <summary> /// 初始化上下文 /// </summary> /// <param name="model"></param> /// <returns></returns> protected virtual ICommandContext GetCommandContext(RecoveryEventModel model) { var context = new DefaultCommandContext() { Worker = new RecoveryWorker() }; return(context); }
/// <summary> /// 发布事件 /// </summary> /// <param name="model"></param> /// <param name="context"></param> protected virtual void PublicEvent(RecoveryEventModel model, out ICommandContext context) { context = this.GetCommandContext(model); AnonymousExtension.PublishEvent(new FilterEventBus(model.EventHandlerType, this.serviceLocator, this.commandBus), model.Event, context); }