EF Core Linq表达式

时间:2018-08-23 05:04:12

标签: mysql entity-framework core

He LINQ表达式

where (((([x].IsDeleted == False) AndAlso ([x].IsActive == True)) AndAlso ([x].NextInvoiceDate < Convert(DateTime.UtcNow, Nullable`1))) OrElse ([x].ScheduleEndDate > Convert(DateTime.UtcNow, Nullable`1)))

无法翻译,将在本地进行评估。

am试图从我的sql数据库中获取记录列表,但在where子句中获取异常

实际linq表达式将如下

  public IList<InvoiceSchedule> GetRecurringInvoiceScheduleToExecute()
    {

        var invoiceSchedule = _InvoiceScheduleSet
                   .Where(x => x.IsDeleted == false
                   && x.IsActive == true
                && x.NextInvoiceDate < DateTime.Today
                  || x.ScheduleEndDate != null ? x.ScheduleEndDate > DateTime.UtcNow : true
                   ).ToList();

        return invoiceSchedule;
    }

0 个答案:

没有答案