Example #1
0
        public async ValueTask <Srv.Dto.Common.List.GridView.Tag> TagAsync(CallContext context = default)
        {
            _logger.LogTrace("Query: " + GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name);

            var repository = await _commonTagRepository.GetAllTagAsync();

            var tagItems = repository.ToList().Select(
                tag => _mapper.Map <Srv.Dto.Common.Tag>(tag)
                ).ToList();

            var commonAutomationTypeDns = await _queryListKeyValue.AutomationTypeIdAsync(context);

            var commonAnalogDigitalDns = await _queryListKeyValue.AnalogDigitalSignalAsync(context);

            var commonTagGroupDns = await _queryListKeyValue.TagGroupIdAsync(context);

            var commonInOutDns = await _queryListKeyValue.InputOutputAsync(context);

            var commonConnectionDns = await _queryListKeyValue.ConnectionIdAsync(context);

            var output = new Srv.Dto.Common.List.GridView.Tag(
                tagItems, commonAutomationTypeDns.List,
                commonAnalogDigitalDns.List, commonTagGroupDns.List,
                commonInOutDns.List, commonConnectionDns.List);

            return(output);
        }