コード例 #1
0
        public async Task CreateDataRequest(MarketDataRequest request)
        {
            this._logger.LogInformation(
                $"repository recording request for {request.MarketIdentifierCode} from {request.UniverseEventTimeFrom} to {request.UniverseEventTimeTo} for {request.Identifiers}.");

            if (string.IsNullOrWhiteSpace(request.Identifiers.Id) ||
                string.IsNullOrWhiteSpace(request.SystemProcessOperationRuleRunId))
            {
                this._logger.LogError(
                    $"CreateDataRequest had a null or empty id for identifiers for financial instrument. {request.Identifiers.Id} - {request.SystemProcessOperationRuleRunId}");
                return;
            }

            try
            {
                this._logger.LogTrace(
                    $"CreateDataRequest about to save request for {request.Identifiers} at {request.UniverseEventTimeFrom} to {request.UniverseEventTimeTo}");
                var dtoRequest = new MarketDataRequestDto(request);

                using (var dbConnection = this._dbConnectionFactory.BuildConn())
                    using (var conn = dbConnection.ExecuteAsync(CreateDataRequestSql, dtoRequest))
                    {
                        await conn;
                        this._logger.LogTrace(
                            $"CreateDataRequest has saved request for {request.Identifiers} at {request.UniverseEventTimeFrom} to {request.UniverseEventTimeTo}");
                    }
            }
            catch (Exception e)
            {
                this._logger.LogError(e, $"repository error for CreateDataRequest");
            }
        }
コード例 #2
0
 private MarketDataRequest Map(MarketDataRequestDto re)
 {
     return(new MarketDataRequest(
                re.Id,
                re.MarketIdentifierCode,
                re.InstrumentCfi,
                new InstrumentIdentifiers(
                    re.InstrumentId,
                    re.InstrumentReddeerId,
                    string.Empty,
                    re.InstrumentClientIdentifier,
                    re.InstrumentSedol,
                    re.InstrumentIsin,
                    re.InstrumentFigi,
                    re.InstrumentCusip,
                    re.InstrumentExchangeSymbol,
                    re.InstrumentLei,
                    re.InstrumentBloombergTicker,
                    re.InstrumentRic,
                    re.InstrumentUnderlyingSedol,
                    re.InstrumentUnderlyingIsin,
                    re.InstrumentUnderlyingFigi,
                    re.InstrumentUnderlyingCusip,
                    re.InstrumentUnderlyingLei,
                    re.InstrumentUnderlyingExchangeSymbol,
                    re.InstrumentUnderlyingBloombergTicker,
                    re.InstrumentUnderlyingClientIdentifier,
                    re.InstrumentUnderlyingRic),
                re.StartTime,
                re.EndTime,
                re.SystemProcessOperationRuleRunId,
                re.Completed,
                (DataSource)re.DataSource));
 }