public async ValueTask <ListKeyValuePair <Guid, string> > TagGroupIdAsync(CallContext context = default) { _logger.LogTrace("Query: " + GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name); var commonTagGroupRepository = await _commonTagGroupRepository.GetAllTagGroupAsync(); var commonTagGroupDns = commonTagGroupRepository.ToList().Select( commonTagGroup => new KeyValuePair <Guid, string>(commonTagGroup.Id, commonTagGroup.Name)) .ToList(); return(new ListKeyValuePair <Guid, string>(commonTagGroupDns)); }
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); }
public async ValueTask <Srv.Dto.Common.List.GridView.TagGroup> TagGroupAsync(CallContext context = default) { _logger.LogTrace("Query: " + GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name); try { var repository = await _commonTagGroupRepository.GetAllTagGroupAsync(); var tagGroupItems = repository.ToList().Select( tagGroup => _mapper.Map <Srv.Dto.Common.TagGroup>(tagGroup) ).ToList(); var output = new Srv.Dto.Common.List.GridView.TagGroup(tagGroupItems); return(output); } catch (Exception ex) { _logger.LogError("Query: " + GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name + " - " + ex.Source + " " + ex.Message + " - " + ex.StackTrace); return(await new ValueTask <Dto.Common.List.GridView.TagGroup>()); } }