C#: implicit operator and extension methods

前端 未结 3 2068
暗喜
暗喜 2021-01-11 11:39

I am trying to create a PredicateBuilder class which wraps an Expression> and provides some methods to easily bu

3条回答
  •  北海茫月
    2021-01-11 12:21

    No, you haven't, but C# compiler's type deduction isn't powerful enough to understand your code, and in particular, it doesn't look at implicit operators. You'll have to stick with Expression> — why not have extension methods like Or, And directly on expressions?

提交回复
热议问题