2
我有Linq到SQL查詢返回一個字段與Url,我將它綁定到asp.net組合框。我需要在綁定結果之前將新的虛擬記錄(「All Url」)添加到Linq to SQL結果中。怎麼做?Linq添加額外的數據到SQL結果
var results =
dataAccess.Statistics.
Where(s => s.DateStamp >= minDate && s.DateStamp <= DateTime.UtcNow && s.UserId == userId).
GroupBy(s => s.Url).
Where(g => g.Count() > 1).
OrderBy(g => g.Count()).
Select(g => new { Url = dataAccess.getDomain(g.Key) });
ddlDomain.DataSource = results;
ddlDomain.DataBind();