EntitySet.Where(myPredicate) throws NotSupportedException

前端 未结 3 918
不知归路
不知归路 2021-01-18 15:34

EDIT: Let\'s try this again. This time I\'ve used the AdventureWorks sample database so you can all play along. This will rule out anything crazy I\'ve do

3条回答
  •  暖寄归人
    2021-01-18 15:55

    I'd refactor the original like this

    private bool IsYourPredicateSatisfied(Maintenance plan)
    {
      return plan.CancelDate == null && plan.UpgradeDate == null;
    }
    

    Then your Where clause is Where(m => IsYourPredicateSatisfied(m))

提交回复
热议问题