我已经声明了一个这样的自定义集合类:
public class WipCommesse
{
private string FNumCommessa;
private int FIdTipologia, FTotQtaLetta;
public int IdTipologia
{
get { return FIdTipologia; }
set { FIdTipologia = value; }
}
public string NumCommessa
{
get { return FNumCommessa; }
set { FNumCommessa = value; }
}
public int TotQtaLetta
{
get { return FTotQtaLetta; }
set { FTotQtaLetta = value; }
}
}
public class WipCommesseList : List<WipCommesse>
{
}
Run Code Online (Sandbox Code Playgroud)
在我的代码中,我使用 Linq 对另一个列表进行分组,并且我想转换为我的自定义类型
WipCommesseList wipGrouped =
(WipCommesseList)myList.GroupBy(x => new
{
x.IdTipologia,
x.NumCommessa …Run Code Online (Sandbox Code Playgroud)