Ejemplo n.º 1
0
 private static Task <ValueResponse> SendValuesThoughRpcAsync(ValueRequest request, MessageContext context)
 {
     return(Task.FromResult(new ValueResponse
     {
         Value = $"value{request.Value}"
     }));
 }
Ejemplo n.º 2
0
        public ActionResult <ValueResponse> Create([FromBody] ValueRequest request)
        {
            var value = valueService.Create(new Value
            {
                Titulo = request.Titulo
            });

            return(CreatedAtRoute("GetValue", new { id = value.Id.ToString() }, new ValueResponse(value)));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> AddNewValue([FromBody] ValueRequest request)
        {
            var result = await _sender.SaveOne(request.Value);

            if (result)
            {
                return(Ok());
            }
            return(Problem());
        }
Ejemplo n.º 4
0
        private static Task <ValueResponse> SendValuesThoughRpcAsync(ValueRequest request)
        {
            Console.Out.WriteLine($"Responding to request: {request.Value}");
            var randomString = RandomString(100000);

            return(Task.FromResult(new ValueResponse
            {
                Value = randomString
            }));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> GetNestedApp1V1Values()
        {
            _helloService.SayHello();
            _globalHelloService.SayHello();
            var request = new ValueRequest()
            {
                AppIndex        = 1,
                EndpointVersion = 1
            };
            var results = await _mediator.Send(request);

            return(await Task.FromResult <IActionResult>(Ok( results )));
        }
Ejemplo n.º 6
0
        public IActionResult Update(long id, [FromBody] ValueRequest request)
        {
            Value value = valueService.Get(id);

            if (value == null)
            {
                return(NotFound());
            }

            valueService.Update(id, value);

            return(NoContent());
        }
Ejemplo n.º 7
0
        // Returns latest value of monitored Node
        public override Task <ValueResponse> GetValue(ValueRequest request, ServerCallContext context)
        {
            int value;

            if (MonitoringClient.LatestValue.HasValue)
            {
                value = MonitoringClient.LatestValue.Value;
                Console.WriteLine("Sending a value of {0} for server at DiscoveryURL {1}", value, Program.OpcuaServerDiscoveryURL);
            }
            else
            {
                Console.WriteLine("No value available for server at DiscoveryURL {0}, sending value of 0", Program.OpcuaServerDiscoveryURL);
                value = 0;
            }
            return(Task.FromResult(new ValueResponse
            {
                Value = value,
                OpcuaServer = Program.OpcuaServerDiscoveryURL
            }));
        }
 public IResponseBase Set(SetRequest request, ValueRequest valueRequest) 
 {
     throw new Exception("Test");
     
 }
Ejemplo n.º 9
0
 public bool Matches(ValueRequest request)
 {
     return _matches(request);
 }
Ejemplo n.º 10
0
 public IGenerator Build(ValueRequest request)
 {
     return _generator;
 }
Ejemplo n.º 11
0
 public bool Matches(ValueRequest request)
 {
     return true;
 }
Ejemplo n.º 12
0
 public IGenerator Build(ValueRequest request)
 {
     var type = request.Accessor() == null ? request.Type : request.Accessor().PropertyType;
     return _generators[type];
 }
 public IGenerator Build(ValueRequest request)
 {
     return new ProtectedEntityGenerator(request.Type, _graph);
 }
 public bool Matches(ValueRequest request)
 {
     var isEntity = request.Type.Namespace.StartsWith(typeof (EntityMarker).Namespace);
     var isPropertyRequest = request.Accessor() != null;
     return isEntity && !isPropertyRequest &&
             request
                 .Type
                 .GetConstructors(BindingFlags.Public | BindingFlags.Instance)
                 .Length
                 .Equals(0);
 }
Ejemplo n.º 15
0
 public PropertyMap(ValueRequest request, Func<IGenerator> generatorResolver)
 {
     Request = request;
     _generatorResolver = generatorResolver;
 }