示例#1
0
        public IActionResult TextDetails(Riderct id)
        {
            RegisterResponse reply = new RegisterResponse {
                Id = id.Resp
            };


            using var channel = GrpcChannel.ForAddress("http://localhost:5000");
            var client = new Job.JobClient(channel);
            var repl   = client.GetProcessingResult(reply);

            return(View("GetTask", repl));
        }
示例#2
0
        public async Task <IActionResult> GetTask(string taskDescription, string data)
        {
            if (taskDescription == null)
            {
                return(View("Error", new ErrorViewModel {
                    RequestId = "No Task"
                }));
            }

            AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
            using var channel = GrpcChannel.ForAddress("http://localhost:5000");
            var client             = new Job.JobClient(channel);
            RegisterResponse reply = await client.RegisterAsync(
                new RegisterRequest { Description = taskDescription, Data = data });

            Riderct id = new Riderct {
                Resp = reply.Id
            };

            return(RedirectToAction("TextDetails", id));
        }