Urgently report an error and ask for help:variable ‘candidate’ of type ‘xxxx’ referenced from scope ”, but itxxxxx

When I use lamdba expressions to query data, the writing is like this:

   var exp = CreateExpression<AlterApply>();

   orgCode = "123456789";

   exp = exp.AndAlso(t => orgCode.Contains(t.OrgCode));

Write like this will report an error,But writing this way will not report an error:

        var exp = CreateExpression<AlterApply>();

        orgCode = "123456789";

        exp = exp.AndAlso(t => t.OrgCode == orgCode);

But I have to write the first method, because the orgCode variable is a parameter, and will be longer than AlterApply.OrgCode, how should I deal with such a problem



Read more here: https://stackoverflow.com/questions/66997750/urgently-report-an-error-and-ask-for-help-variable-candidate-of-type-xxxx-re

Content Attribution

This content was originally published by DevilJessse at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: