private static Task <ValueResponse> SendValuesThoughRpcAsync(ValueRequest request, MessageContext context) { return(Task.FromResult(new ValueResponse { Value = $"value{request.Value}" })); }
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))); }
public async Task <IActionResult> AddNewValue([FromBody] ValueRequest request) { var result = await _sender.SaveOne(request.Value); if (result) { return(Ok()); } return(Problem()); }
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 })); }
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 ))); }
public IActionResult Update(long id, [FromBody] ValueRequest request) { Value value = valueService.Get(id); if (value == null) { return(NotFound()); } valueService.Update(id, value); return(NoContent()); }
// 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"); }
public bool Matches(ValueRequest request) { return _matches(request); }
public IGenerator Build(ValueRequest request) { return _generator; }
public bool Matches(ValueRequest request) { return true; }
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); }
public PropertyMap(ValueRequest request, Func<IGenerator> generatorResolver) { Request = request; _generatorResolver = generatorResolver; }