Пример #1
0
        public async Task <string> DDFill()
        {
            var       dt = DD;
            DataRow   row;
            int       nor = 0;
            Stopwatch sw  = new Stopwatch();
            var       ct  = new CancellationToken();


            dt.BeginLoadData();
            sw.Start();

            /*
             * using (var call = client.ListFeatures(request))
             *      {
             *          var responseStream = call.ResponseStream;
             *          StringBuilder responseLog = new StringBuilder("Result: ");
             *
             *          while (await responseStream.MoveNext())
             */
            var rt = grpcService.channel;

            using (var call = grpcService.ClientCRUDs.DDFill(new QryProxy {
                Query = "", Param = ""
            }))
            {
                while (await call.ResponseStream.MoveNext(CancellationToken.None))
                {
                    row = dt.NewRow();

                    ProxyHelper.ProxyToRow(dt, row, call.ResponseStream.Current);
                    dt.Rows.Add(row);

                    nor++;
                }
            }
            sw.Stop();
            dt.AcceptChanges();
            dt.EndLoadData();
            return($"{nor:n0} records retrieved in {sw.ElapsedMilliseconds:n0} ms");
        }