To a great god help solve, thank you!
ReportReport=orderList. AsParallel (). The Select (item=& gt;
{
//this part to extract all
Var model=new FaultReportReportModel ()
{
OrderNo=item. OrderNo
};
//this part to extract a subset is only the first data is normal, other data are all empty,
Var raultReasons="";
Foreach (var fr in the item. RepairRecords)
{
Foreach (var r in fr. FaultReasons)
{
RaultReasons +=r.N ame + ", ";
}
}
if (! String. IsNullOrWhiteSpace (raultReasons))
Model. FaultReasons=raultReasons. Substring (0, raultReasons. Length - 1);
Return the model;
}). ToList ();
CodePudding user response:
Oh my god, now that heavy, CSDN now no one to play?CodePudding user response:
Not sure if just listIf you remove the AsParallel after consistent?
And since you are linq..
Then your code is not
OrderList. Select (d=& gt; New XXXX () {orderno=d.o rderno, respons=string. Join (", ", d=& gt; D.r ecds. Select (x=& gt; X.n ame)}). Tolist ();
Why also cycle...