limit method to only be called by a particular class

No. The only thing you could do would be to make LimitedAccess a private method, and nest class B within class A.

(I’m assuming you want all the classes in the same assembly. Otherwise you could put A and B in the same assembly, and C in a different assembly, and make LimitedAccess an internal method.)

Leave a Comment