0
以下是LINQ
到SQL
查詢?如何將解釋的linq查詢轉換爲本地linq查詢
Regex wordCounter = new Regex (@"\b(\w|[-'])+\b");
IEnumerable<MedicalArticle> sqlQuery = dataContext.MedicalArticles
.Where (article => article.Topic == "influenza");
IEnumerable<MedicalArticle> localQuery = sqlQuery
.Where (article => wordCounter.Matches (article.Abstract).Count < 100);
Exception
是因爲SQL
服務器不支持正則表達式。我如何投IQueryable<T>
到IEnumberable<T>
?
在此先感謝。
使用ToList()或AsEnumerable()類似sqlQuery.ToList()。Where(...) – Sarathy 2015-03-03 05:23:25