내 코드 :NotSupportedException이 사용자 코드에 의해 처리되지 않은했다
i f(!string.IsNullOrWhiteSpace(gender))
if (gender == "NULL")
predicate = predicate.And(x => string.IsNullOrWhiteSpace(gender));
else
predicate = predicate.And(x => x.Gender == gender);
성별 NULL이고 언제가 흐르는 라인을 실행하고 때
var filteredUsers = _personExtendedRepository.GetMany(predicate).ToList();
오류가 발생합니다 :
" LINQ to Entities가 'Boolean IsNullOrWhiteSpace (System.String)'메서드를 인식하지 못하고이 메서드를 저장소 식으로 변환 할 수 없습니다. "
주 : 나는 SQL Server 관리 Studio에서 다음 줄을 실행하고 때 :
SELECT * FROM UVW_Sample WHERE Gender IS NULL
기록이 표시된다. 이 문제를 해결하는 방법을 도와주세요.
x.Trim() == ""에서 메시지가 표시되는 것처럼 어셈블리 참조가 누락 되었습니까? 감사. –
string.Trim()? x가 문자열이면 작동해야합니다. – zmbq
확인. 나는 그것을 보게 될 것이다. 감사. –