我想只選擇字符串eventTriggers
(其中包含字段「1」看起來像這樣:「00100010」)LINQ to Entities無法識別方法'Char get_Chars(Int32)'方法,並且此方法無法轉換爲存儲表達式
我已經試過併成功地完成了超過1個電話..但我懷疑其效率。基本上我會想要這樣的東西......但實際上LINQ不支持這一點。
(LINQ to Entities does not recognize the method 'Char get_Chars(Int32)' method, and this method cannot be translated into a store expression.
)
using (var service = new dB.Business.Service.BaseBusinessService<memo>())
{
List<memo> result = service.Repository.GetQuery().Where(p => p.ID == ID && p.eventTriggers[index] == '1').ToList();
}
朝向正確的解任何提示?謝謝 !
您使用的數據庫是? – AakashM
即時通訊使用存儲庫...一秒我將編輯 –
它仍然很重要的是後面的數據庫。基本上,如果您希望能夠在數據庫上執行此篩選,則需要以LINQ可以轉換爲數據庫可以理解的某種形式來指定它。如果你有足夠的數據量,你很樂意在過濾之前把它全部帶出數據庫,只需在'.Where()'之前放一個'.AsEnumerable()'。 – AakashM