Ejemplo n.º 1
0
        public ListKeyValuePair <byte, string> BitOfByte(CallContext context = default)
        {
            _logger.LogTrace("Query: " + GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name);

            var bitOfByteRepository = _commonBitRepository.GetAllBit();

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

            return(new ListKeyValuePair <byte, string>(bitOfByteDns));
        }
Ejemplo n.º 2
0
        public Srv.Dto.Logix.List.GridView.LogixTag LogixTag(CallContext context = default)
        {
            _logger.LogTrace("Query: " + GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name);

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

            var commonAnalogDigitalRepository = _commonAnalogDigitalRepository.GetAllAnalogDigital();

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

            var commonTagGroupRepository = _commonTagGroupRepository.GetAllTagGroup();

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

            var commonInOutRepository = _commonInOutRepository.GetAllInOut();

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

            var commonConnectionRepository = _commonConnectionRepository.GetAllConnection();

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

            var commonBitRepository = _commonBitRepository.GetAllBit();

            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);
        }