我正在尝试格式化输出,以便在打印行时看起来像这样
Name Price
LongName Price
Name3 Price
我希望它看起来像一张桌子。这是我的代码
var byValue =
from i in invoices
let total = (i.Quantity * i.Price)
orderby total
select i.PartDescription + " " + total;
foreach (var element in byValue)
Console.WriteLine(element);