var Customer = (from c in DNAContextSQL.Customers
where c.LastName != ""
orderby c.PKID_Customer descending
select new
{
c.PKID_Customer,
c.OrganizationName,
c.FirstName,
c.LastName,
c.Phone,
c.Extension
}).Distinct().ToList();
我知道這是基本的。我找不到任何好的理由,但爲什麼它不工作。發送給SQL事件探查器的查詢似乎沒有其中的order by
子句。linq-> SQL order by descending not working
任何想法?
我可以讓它與.OrderByDescending(...)
一起工作,但想知道這個瘋狂背後的原因。
你是跟蹤你的客戶的DNA嗎?這很硬。我想他們會在你推小刷卡機/針機時拿到你的樣品。編輯 - 「這個星期五,血樣5%!」 – asawyer
哈!也許...;) – emragins
你爲什麼使用.Distinct()? – dwerner