locked
EF use && and || together RRS feed

  • Question

  • User-640622294 posted

    Hi

    please help me for this query

    why vs show error ?

    .Where((s => s.StartDate <= startDate && s.EndDate > endDate) || (s=> s.EndDate > Time))   

    Thursday, April 25, 2019 1:52 PM

Answers

  • User-474980206 posted

    your code is trying to || two lambda expressions together and get a new lambda expression. there is no language support for this. try just using one lama expression:

    .Where(s => (s.StartDate <= startDate && s.EndDate > endDate) || (s.EndDate > Time))   
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 25, 2019 2:03 PM