我有類Product
從表2場選擇並加入他們作爲字符串
public class Product
{
public string Name{get;set;}
public int Quantity{get;set;}
// and other
}
一些操作,我得到List<Product>
後。
如何從列表中創建格式爲productName1(productQuantity1), productName2(productQuantity2), ...
的字符串?
我應該使用String.Join
,但不能得到如何使用它與一些動態對象或KeyValuePair(如果我使用Select
獲得這樣的對象)。
謝謝,實在想不出它是如此容易 – user3625486 2014-12-06 21:49:35