Пример #1
0
        public async ValueTask <ListKeyValuePair <byte, string> > BitOfByteAsync(CallContext context = default)
        {
            _logger.LogTrace("Query: " + GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name);

            var bitOfByteRepository = await _commonBitRepository.GetAllBitAsync();

            var bitOfByteDns = bitOfByteRepository.ToList().Select(
                bitOfByte =>
                new KeyValuePair <byte, string>(bitOfByte.BitOfByte, bitOfByte.BitName))
                               .ToList();

            return(new ListKeyValuePair <byte, string>(bitOfByteDns));
        }
Пример #2
0
        public async ValueTask <Srv.Dto.Logix.List.GridView.LogixTag> LogixTagAsync(CallContext context = default)
        {
            _logger.LogTrace("Query: " + GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name);

            var repository = await _logixTagRepository.GetAllLogixTagAsync();

            var logixTagItems = repository.ToList().Select(
                logixTag => _mapper.Map <Srv.Dto.Logix.LogixTag>(logixTag)
                ).ToList();

            var commonAnalogDigitalRepository = await _commonAnalogDigitalRepository.GetAllAnalogDigitalAsync();

            var commonAnalogDigitalDns = commonAnalogDigitalRepository.ToList().Select(
                commonAnalogDigital =>
                new KeyValuePair <string, string>(commonAnalogDigital.AnalogDigitalSignal, commonAnalogDigital.AnalogDigitalSignal))
                                         .ToList();

            var commonTagGroupRepository = await _commonTagGroupRepository.GetAllTagGroupAsync();

            var commonTagGroupDns = commonTagGroupRepository.ToList().Select(
                commonTagGroup =>
                new KeyValuePair <Guid, string>(commonTagGroup.Id, commonTagGroup.Name))
                                    .ToList();

            var commonInOutRepository = await _commonInOutRepository.GetAllInOutAsync();

            var commonInOutDns = commonInOutRepository.ToList().Select(
                commonInOut =>
                new KeyValuePair <string, string>(commonInOut.InputOutput, commonInOut.InputOutputName))
                                 .ToList();

            var commonConnectionRepository = await _commonConnectionRepository.GetAllConnectionAsync();

            var commonConnectionDns = commonConnectionRepository.ToList().Select(
                commonConnection =>
                new KeyValuePair <Guid, string>(commonConnection.Id, commonConnection.Name))
                                      .ToList();

            var commonBitRepository = await _commonBitRepository.GetAllBitAsync();

            var commonBitDns = commonBitRepository.ToList().Select(
                commonBit =>
                new KeyValuePair <byte, string>(commonBit.BitOfByte, commonBit.BitName))
                               .ToList();

            var output = new Srv.Dto.Logix.List.GridView.LogixTag(
                logixTagItems, commonAnalogDigitalDns, commonTagGroupDns,
                commonInOutDns, commonConnectionDns, commonBitDns);

            return(output);
        }