Predicate designedForChaining
Holds if callable c is designed for chaining. The following must
be fulfilled:
cmust be declared in a reference type.- All callables overriding
cmust be designed for chaining. - If
chas a body, all (and at least one) returned values must bethis. - If
chas no body (abstract/interface callable or library callable), the return type ofcmust be a subtype ofc’s declaring type, andcmust be non-static.
Import path
import semmle.code.csharp.Chainingpredicate designedForChaining(Callable c)