5
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()?它沒有被解決如何從linq到實體查詢到toTraceString()?
File.AppendAllText(traceFile, CurrentStock.toTraceString());
也感謝關於使用動態的建議。 – StackTrace 2012-07-24 07:59:21