public async Task <HistoryReadResponseApiModel <VariantValue> > HistoryReadRawAsync(
            string endpointId, [FromBody][Required] HistoryReadRequestApiModel <VariantValue> request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }
            var readresult = await _client.HistoryReadAsync(
                endpointId, request.ToServiceModel(d => d));

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

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

            return(result.ToApiModel());
        }
        public async Task <HistoryReadResponseApiModel <HistoricValueApiModel[]> > HistoryReadValuesAsync(
            string endpointId,
            [FromBody][Required] HistoryReadRequestApiModel <ReadValuesDetailsApiModel> request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }
            var readresult = await _historian.HistoryReadValuesAsync(
                endpointId, request.ToServiceModel(d => d.ToServiceModel()));

            return(readresult.ToApiModel(d => d?.Select(v => v.ToApiModel()).ToArray()));
        }