Been reading through a lot of Q's and posts and see that subqueries/nested queries/query composition will not be supported until the next version. However I'm not sure if that is what I need, in my head it I would write it that way but I might be complicating things.
I imagine it like
WARN IF Count > 0 IN
SELECT TYPES WHERE
IsDirectlyUsing "MTNE.Web.OneWeb.^.*\p{Proxy}+$" IN
SELECT TYPES WHERE DeriveFrom "System.Web.Services.Protocols.SoapHttpClientProtocol"
So what I'd like to do is check if types are directly using other types in a given namespace which has the suffix Proxy, and that the proxy type is derived from SoapHttpClientProtocol. If a type is directly using the proxy type announce a warning.
Suggestions, hints, tips, pointers or answers anyone?
There are several ways to write the query asked with Code Rule over LINQ Query (CQLinq). Certainly the most elegant, concise and optimized way is:
Notice how we first define 2 sets, and also use the extension method ToHashSet() to optimize the execution of the Intersect() method.
Notice also the usage of the method UsingAny() that, in a single call, perform a lot of work.