Пример #1
0
        public async ValueTask <App.Dto.Res.Import.S7.S7Connection> ImportAsync(App.Dto.Req.Import.S7.S7Connection request, CancellationToken cancellationToken = default)
        {
            CallOptions = CallOptions.WithCancellationToken(cancellationToken);
            CallContext = new CallContext(CallOptions, CallContextFlags.IgnoreStreamTermination);
            App.Dto.Res.Import.S7.S7Connection output = new App.Dto.Res.Import.S7.S7Connection();
            try
            {
                using (Channel)
                {
                    var client = Channel.CreateGrpcService <ICommandAsync>();

                    var result = await client.ImportS7ConnectionAsync(request, CallContext);

                    output = result;
                }
            }
            catch (Exception ex)
            {
                Logger.LogError(GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name + " - " + ex.Source + " " + ex.Message + " " + ex.StackTrace);
            }
            return(output);
        }
Пример #2
0
 public async ValueTask <App.Dto.Res.Import.S7.S7Connection> ImportAsync(App.Dto.Req.Import.S7.S7Connection exportItem, CancellationToken cancellationToken = default)
 {
     return(await _s7Connection.ImportAsync(exportItem, cancellationToken));
 }
Пример #3
0
 public App.Dto.Res.Import.S7.S7Connection ImportS7Connection(App.Dto.Req.Import.S7.S7Connection request, CallContext context = default)
 {
     return(_commandHandler.ExecuteWithResponse <App.Dto.Req.Import.S7.S7Connection, App.Dto.Res.Import.S7.S7Connection>(_loggerFactory, _componentContext, request));
 }
Пример #4
0
 public App.Dto.Res.Import.S7.S7Connection Import(App.Dto.Req.Import.S7.S7Connection exportItem, CancellationToken cancellationToken = default)
 {
     return(_s7Connection.Import(exportItem));
 }
Пример #5
0
 public async ValueTask <App.Dto.Res.Import.S7.S7Connection> ImportS7ConnectionAsync(App.Dto.Req.Import.S7.S7Connection request, CallContext context = default)
 {
     return(await _commandHandlerAsync.ExecuteWithResponseAsync <App.Dto.Req.Import.S7.S7Connection, App.Dto.Res.Import.S7.S7Connection>(_loggerFactory, _componentContext, request, context.CancellationToken));
 }