c# - report a list to async method -



how can report progress of query list main thread

 async private void getproductdata()     {         progress<list<string>> progress = new progress<list<string>>(                 data => _prc.add(new productlist() {                     name  = data[1],                     delay = data[2],                     taxe  = data[3],                 }));         await task.run(() => gettabledatafromdb(progress, "foe_diesel_high_cb"));      }   private void gettabledatafromdb(iprogress<list<string>> progress, string tabelname)     {           //query logic , report progress            while (reader.read())            {               progress.report(??);            }     } 

when try report list of strings list<\string> or string array string[], data displayed on grid has same values , app becomes slow.
when try report single string works fine.
thanks


Comments