我正在尝试在 Where 子句中创建一个带有 4 个参数的 LINQ 查询。这是一个 Windows 8 App 项目,我使用的是 SQLite 数据库。(SQLite 实现)
这是代码片段:
public List<FinancialListBoxExpenseItem> retrieveExpenseItems(int month, int year, bool isPaid, StaticResources.FrequencyEnum frequencyEnum)
{
List<FinancialListBoxExpenseItem> tmpList = null;
connection.RunInTransaction(() =>
{
var items = from s in connection.Table<FinancialListBoxExpenseItem>()
where (s.expenseDateNextPayment.Month == month)
&& (s.expenseDateNextPayment.Year == year)
&& (s.expensePaidForCurrentPeriod == isPaid)
&& (s.expenseFrequencyTypeEnum == frequencyEnum)
select s;
tmpList = items.ToList<FinancialListBoxExpenseItem>();
});
return tmpList;
}
它抛出 NotSupportedAction: Member access failed to compile expression 异常
我不知道这是什么意思以及我应该如何解决它。
编辑:它在没有 where 子句的情况下工作,因此错误必须与代码的这个 where 子句部分有关