1
私はGoogleでとSO強く型付けされたList.GroupBy()
にこれに対する答えを見つけるためにしようとしてきたが、どこにでも、私は匿名で、私はacheiveしようとしていますどのような結果リスト
を入力使用し発見しました各SecondaryStandard
この
List<SecondaryStandard>
を取ると、SecondaryStandard
のグループ化されたリストを作成することです
public class SecondaryStandard
{
public string Id { get; set; }
public int IdNumeric { get; set; }
public string IdText { get; set; }
public Sample Sample { get; set; }
public string StandardName { get; set; }
public DateTime DateCompleted { get; set; }
public SamplePoint SamplingPoint{ get; set; }
public Instrument Instrument{ get; set; }
public string ContainerId { get; set; }
public double Value { get; set; }
public string ComponentName { get; set; }
public string PointLocation { get; set; }
public string Description { get; set; }
public string Description2 { get; set; }
public string Analysis { get; set; }
public string Units { get; set; }
}
私が欲しいのは、Valueプロパティが各ComponentNameの結果の平均であるList()です。
強く型付けされた方法でこれを達成する方法や、匿名のオブジェクトを使用して私が探しているものを達成するために必要なアイデアはありますか?
'List <>'にはvalueプロパティはありません。カスタムコレクションタイプを作成する必要があります。 – phoog
おそらく結果がどうなるかを明確にすることができますか?値を持つリスト 'SecondaryStandard>を例にして、望みの結果を得たら、そこに到達する方法を見ることができます。 – Tejs
値はSecondary Standardのプロパティです –