public async Task <HistoryReadNextResponseApiModel <VariantValue> > HistoryReadRawNextAsync(
            string endpointId, [FromBody][Required] HistoryReadNextRequestApiModel request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }
            var readresult = await _client.HistoryReadNextAsync(
                endpointId, request.ToServiceModel());

            return(readresult.ToApiModel(d => d));
        }
Beispiel #2
0
        /// <summary>
        /// Read next history
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <HistoryReadNextResponseApiModel> HistoryReadNextAsync(
            HistoryReadNextRequestApiModel request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }
            var result = await _historian.HistoryReadNextAsync(
                _twin.Endpoint, request.ToServiceModel());

            return(new HistoryReadNextResponseApiModel(result));
        }
        /// <summary>
        /// Read next history
        /// </summary>
        /// <param name="endpoint"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <HistoryReadNextResponseApiModel <VariantValue> > HistoryReadNextAsync(
            EndpointApiModel endpoint, HistoryReadNextRequestApiModel request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }
            var result = await _historian.HistoryReadNextAsync(
                endpoint.ToServiceModel(), request.ToServiceModel());

            return(result.ToApiModel());
        }
        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(readresult.ToApiModel(d => d?.Select(v => v.ToApiModel()).ToArray()));
        }