コード例 #1
0
        public async ValueTask <ListKeyValuePair <string, string> > InputOutputAsync(CallContext context = default)
        {
            _logger.LogTrace("Query: " + GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name);

            var commonInOutRepository = await _commonInOutRepository.GetAllInOutAsync();

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

            return(new ListKeyValuePair <string, string>(commonInOutDns));
        }
コード例 #2
0
ファイル: QueryAsync.cs プロジェクト: maniepiedi/KSociety.Com
        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);
        }