public ActionResponse Send <B, T>(T action) where B : class, IAction where T : B { _busLogger.Sent(action); ActionResponse response = _bus.Request <B, ActionResponse>(action); _busLogger.Received(response); return(response); }
public void FlushAnEvent <T>(T @event) where T : IEvent { _busLogger.Sent(@event); DistributeToExternalQueue(@event); // Since TransactionScope has completed, can not write database in current thread scope. //Invoke((dynamic)@event); DistributeInThreadPool((dynamic)@event); }
private ActionResponse Work(ACE.IAction action) { ActionResponse response = new ActionResponse(); try { using (var scope = _container.BeginLifetimeScope()) { Invoke((dynamic)action); } } catch (ACE.Exceptions.BusinessException ex) { response.Result = ActionResponse.ActionResponseResult.NG; response.Message = ex.Message; } catch (Exception ex) { response.Result = ActionResponse.ActionResponseResult.Exception; response.Message = ex.Message; } _busLogger.Sent(response); return(response); }