Beispiel #1
0
        public Dto.Res.Biz.WriteLog Execute(Dto.Req.Biz.List.WriteLog request)
        {
            var output = new Dto.Res.Biz.WriteLog(false);

            try
            {
                var list = request.List.Select(message => _mapper.Map <WriteLogEvent>(message)).ToList();
                _biz.WriteLogs(list);
            }
            catch (Exception ex)
            {
                _logger.LogError("WriteLogsReqHdlr Execute:  " + ex.Message + " - " + ex.StackTrace);
            }

            return(output);
        }
Beispiel #2
0
        public WriteLog WriteLogs(App.Dto.Req.Biz.List.WriteLog request, CancellationToken cancellationToken = default)
        {
            CallOptions = CallOptions.WithCancellationToken(cancellationToken);
            CallContext = new CallContext(CallOptions, CallContextFlags.IgnoreStreamTermination);
            WriteLog output = new WriteLog();

            try
            {
                using (Channel)
                {
                    IBiz client = Channel.CreateGrpcService <IBiz>();

                    var result = client.WriteLogs(request, CallContext);

                    output = result;
                }
            }
            catch (Exception ex)
            {
                Logger.LogError(GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name + " - " + ex.Source + " " + ex.Message + " " + ex.StackTrace);
            }
            return(output);
        }