문제

모두 안녕! 나는 다음과 같은 쿼리를 구성하려고합니다.

여기서 column = "value"및 column2 = "value"및 (column3 = "value"또는 column4 = "value")

이 코드가 있습니다.

return new Select()
               .From(LessonChallenge.Schema)
               .Where(LessonChallenge.ChallengerStatusColumn).IsEqualTo("Finished")
               .And(LessonChallenge.ChallengeeStatusColumn).IsEqualTo("Finished")
               .OpenExpression()
                    .And(LessonChallenge.ChallengerAccountIDColumn).IsEqualTo(accountID)
                    .Or(LessonChallenge.ChallengeeAccountIDColumn).IsEqualTo(accountID)
               .CloseExpression()
               .OrderDesc("dateCompleted")
               .Paged(1, numItems)
               .ExecuteAsCollection<LessonChallengeCollection>();

문제는 Subsonic이 괄호와 괄호 후에 추가하고 있다는 것입니다. 어떻게 부정 할 수 있습니까?

도움이 되었습니까?

해결책

할 수 있어야합니다.

return new Select()
           .From(LessonChallenge.Schema)
           .Where(LessonChallenge.ChallengerStatusColumn).IsEqualTo("Finished")
           .And(LessonChallenge.ChallengeeStatusColumn).IsEqualTo("Finished")
           .AndExpression(LessonChallenge.ChallengerAccountIDColumn).IsEqualTo(accountID)
                .Or(LessonChallenge.ChallengeeAccountIDColumn).IsEqualTo(accountID)
           .OrderDesc("dateCompleted")
           .Paged(1, numItems)
           .ExecuteAsCollection<LessonChallengeCollection>();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top