dynamic traceFile = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\EntityFrameworkTrace.log";
var CurrentStock = (from s in DBViews.StockStatus
where s.ProductID != 10
orderby s.ProductName
select new
{
s.ProductID,
s.ProductName,
CurrentStock = s.TotalStocked - s.TotalSold,
s.CurrentSellingRate,
CashValue = (s.TotalStocked - s.TotalSold) * s.CurrentSellingRate,
s.LastStocked,
s.LastCostPrice,
s.LastQtyStocked
}).ToList();
File.AppendAllText(traceFile, CurrentStock.toTraceString());
return CurrentStock.ToList();
如何在以下行中从 CurrentStock 获取 toTraceString() ?它没有得到解决
File.AppendAllText(traceFile, CurrentStock.toTraceString());