public KSociety.Com.App.Dto.Res.Transaction.GetTagValue Execute(GetTagValue request) { var output = new KSociety.Com.App.Dto.Res.Transaction.GetTagValue(); //_logger.Trace("GetTagValue Execute: " + request.GroupName + " - " + request.TagName + " - " + _startup.SystemGroups.Count); try { var result = _startup.GetTagValue(new TagReadIntegrationEvent(request.GroupName + ".automation.read", ".automation.read", request.GroupName, request.TagName)); output.GroupName = result.GroupName; output.TagName = result.TagName; output.Value = result.TagValue; } catch (Exception ex) { _logger.LogError("GetTagValue Execute: " + ex.Message + " - " + ex.StackTrace); } return(output); }
public App.Dto.Res.Biz.GetTagValue GetTagValue(GetTagValue request, CancellationToken cancellationToken = default) { CallOptions = CallOptions.WithCancellationToken(cancellationToken); CallContext = new CallContext(CallOptions, CallContextFlags.IgnoreStreamTermination); App.Dto.Res.Biz.GetTagValue output = new App.Dto.Res.Biz.GetTagValue(); try { using (Channel) { IBiz client = Channel.CreateGrpcService <IBiz>(); var result = client.GetTagValue(request, CallContext); output = result; } } catch (Exception ex) { Logger.LogError(GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name + " - " + ex.Source + " " + ex.Message + " " + ex.StackTrace); } return(output); }