public async Task Update(ISystemProcessOperationDistributeRule entity) { if (entity == null) { return; } try { using (var dbConnection = this._dbConnectionFactory.BuildConn()) using (var conn = dbConnection.ExecuteAsync(UpdateSql, entity)) { await conn; } } catch (Exception e) { this._logger.LogError(e, $"System Process Operation Distribute Rule Repository Update Method For {entity.Id} {entity.SystemProcessOperationId}."); } }
public void Log(Exception e, ISystemProcessOperationDistributeRule distributeRule) { if (distributeRule == null) { this.Log(e); return; } var dto = new ExceptionDto { ExceptionMessage = e.Message, InnerExceptionMessage = e.InnerException?.Message, StackTrace = e.StackTrace, SystemProcessOperationDistributeRuleId = distributeRule.Id, SystemProcessOperationId = distributeRule.SystemProcessOperationId, SystemProcessId = distributeRule.SystemProcessId }; this._exceptionRepository.Save(dto); }
public async Task Create(ISystemProcessOperationDistributeRule entity) { if (entity == null) { return; } lock (this._lock) { try { this._logger.LogInformation($"SystemProcessOperationDistributeRuleRepository SAVING {entity}"); using (var dbConnection = this._dbConnectionFactory.BuildConn()) using (var conn = dbConnection.QuerySingleAsync <int>(CreateSql, entity)) { entity.Id = conn.Result; } } catch (Exception e) { this._logger.LogError(e, $"System Process Operation Distribute Rule Repository Create Method For {entity.Id} {entity.SystemProcessOperationId}."); } } }
public void StartEvent(ISystemProcessOperationDistributeRule distributeRule) { this._distributeRule = distributeRule; this._repository.Create(this._distributeRule); }