Пример #1
0
        public async Task <HistoryReadNextResponseApiModel <JToken> > HistoryReadRawNextAsync(
            string endpointId, [FromBody][Required] HistoryReadNextRequestApiModel request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }
            var readresult = await _client.HistoryReadNextAsync(
                endpointId, request.ToServiceModel());

            return(HistoryReadNextResponseApiModel <JToken> .Create(readresult, d => d));
        }
Пример #2
0
        public async Task <HistoryReadNextResponseApiModel <HistoricEventApiModel[]> > HistoryReadEventsNextAsync(
            string endpointId,
            [FromBody][Required] HistoryReadNextRequestApiModel request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }
            var readresult = await _historian.HistoryReadEventsNextAsync(
                endpointId, request.ToServiceModel());

            return(HistoryReadNextResponseApiModel <HistoricEventApiModel[]> .Create(readresult,
                                                                                     d => d?.Select(v => v == null ? null : new HistoricEventApiModel(v)).ToArray()));
        }