Friday, June 11, 2010

Using ConvertAll and Aggregate in LINQ


string strImportResult = this.ImportResult.ToList()
.ConvertAll<string>(Import => string.Format("<tr><td>
{0}</td><td>{1}</td><td>{2}</td><td>
{3}</td></tr>"

, Import.CustodianName
, Import.ImportFile
, Import.ImportStatus
, Import.Particular))
.Aggregate((ImportA, ImportB) => ImportA + ImportB);

No comments: