Prevent Cast Between Two Interfaces
问题 I have an internal class which contains implementation details, including properties, which should not be publicly accessible. I have to pass this class to public callers, and allow them to pass it around, store it, serialize it, or do basically whatever they want with it. The class can be accessed publicly in two different ways. These ways are exposed as two public interfaces. I would like to prevent the user from casting between the two public interfaces. Here is some code to demonstrate