我有这些情况:
//This class maps to the "Item" table in the database
public class Item
{
public int itemID { get; set;}
public string itemName { get; set; }
public int quantity { get; set; }
}
//Items record are returned from the database as list
List<Item> items = ItemDAO.GetItems();
我想生成一个包含聚合值的报告(来自查询/存储过程)
ItemID| ItemName | Qty | QtySoldThisMonth | QtySoldThisYr
-----------------------------------------------------------
123 | Vit. C | 20 | 55 | 400
239 | Maloxin | 25 | 12 | 210
Item 类没有这些额外的字段 这对于可能具有不同列数的数据表会更容易,但我使用的是列表
请问,我该怎么做