Well, actually the compiler tells you already what's wrong :)
' Operator '==' cannot be applied to operands of type 'bool' and 'AliasRnD.YesNo'
And that's the line
var y4 = from p in Dc.Table4s where funtion(p) == YesNo.Yes select p;
There you are comparing a bool (function(p)) with an enum.
To solve it, just drop the comparison. It would be reduntant anyway. You defined your function as IsEqual( YesNo.Yes ) above.
var y4 = from p in Dc.Table4s where funtion(p) select p;
Best regards