Enumerating the Results of a LINQ to HPC Query
Many LINQ to HPC queries produce enumerable results. In these cases, it is possible to execute the query and to retrieve the results simply by using the query as an enumeration. The following code prints the lines of a text-based DSC file set to the console.
var config = new HpcLinqConfiguration("MyHpcClusterHeadNode");
var context = new HpcLinqContext(config);
string textData = ...
var lines = context.FromDsc<LineRecord>(textData)
.Select(r => r.Line);
foreach(var line in lines)
Console.WriteLine(line);
Show: