How can I clean up this LINQ Query to use SelectMany in the sql syntax, instead of method chaining at the end like I have done?
var runPeakWidths =
(from ipa in runAnalysis.PassAnalyses
let peakWidths = BuildPeakWidths(ipa)
select peakWidths)
.SelectMany(data => data);
Edit: Turned into a tight little method:
public void CreateRunStatistics(Func<IPassAnalysis, IEnumerable<double>> buildMethod, string name)
{
var data = runAnalysis.PassAnalyses.SelectMany(buildMethod);
statistics.Add(StatisticsBase.Calc(name, data));
}
Thanks!