Exemplo n.º 1
0
 public override Task <proto.Robot> Get(proto.RobotGetRequest request, ServerCallContext context)
 {
     return(new GrpcService <proto.Robot>(context, async() =>
     {
         var __req = request ?? new proto.RobotGetRequest();
         var __result = await _manager.GetAsync(Transformers.GuidToStringConverter.ConvertToSrce(__req.Id));
         return _mapper.Map <Robot, proto.Robot>(__result !) !;
     }, operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NotFound).ExecuteAsync());
Exemplo n.º 2
0
        public Task <GrpcAgentResult <Robot> > GetAsync(Guid id, GrpcRequestOptions?requestOptions = null)
        {
            var __req = new proto.RobotGetRequest {
                Id = Transformers.GuidToStringConverter.ConvertToDest(id)
            };

            return(InvokeAsync((c, o) => c.GetAsync(__req, o), __req, Transformers.Robot, requestOptions));
        }