İşlevde bir iade türü olarak anonim bir yazı tipini kullanabilir ve sonra da bu yeni bir dizi/koleksiyona ek bir alan eklerken bir döndürülen değeri bir diziye veya bir dizi koleksiyonuna sığdırıyor mu? ... benim pseudocode mazurDönüş Anonim İşlevden dön
private var GetRowGroups(string columnName)
{
var groupQuery = from table in _dataSetDataTable.AsEnumerable()
group table by new { column1 = table[columnName] }
into groupedTable
select new
{
groupName = groupedTable.Key.column1,
rowSpan = groupedTable.Count()
};
return groupQuery;
}
private void CreateListofRowGroups()
{
var RowGroupList = new List<????>();
RowGroupList.Add(GetRowGroups("col1"));
RowGroupList.Add(GetRowGroups("col2"));
RowGroupList.Add(GetRowGroups("col3"));
}
olası yinelenen [C# Anonim Tipi Nesneleri erişme] (http://stackoverflow.com/questions/713521/accessing-c-sharp -anonymous-type-objects) – nawfal
olası imi [Return anonymous type?] (http://stackoverflow.com/questions/534690/return-anonymous-type) –