You could do this by creating an interface with an inner scope and using this in your generic expression, where is the sentence (the common class / method must be in the same assembly). Then you can use it only with classes in the same assembly that implement this interface.
If you needed to go through classes from another assembly, you could add the global :: InternalsVisibleToAttribute ("another assembly name") to the AssemblyInfo file.
All that has been said is still not like what one can try to achieve.
source share