public ExecutionResult ExecuteRequest(BaseDataToken data) { if (data is FinanceDataToken) { var execResult = _actionDict[data.ActionName]((FinanceDataToken)data); if (execResult.Succeed) { Task.Run(() => { _routeContainer.MailHandler.SendMail(_routeContainer.RouteMessage, execResult, data.Name); }); } return(execResult); } else { throw new ArgumentException("Data is invalid"); } }
public ExecutionResult GetUserInfo(BaseDataToken data) { _routeContainer.MailHandler.SendMail(_routeContainer.RouteMessage, new ExecutionResult(true, "Good Good"), data.Name); return(new ExecutionResult(true, _moneyList[data.Name].ToString())); }