Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide System.Object methods (ToString, GetHashCode, Equals, and GetType) from common API classes #689

Closed
dotnetjunkie opened this issue Apr 24, 2019 · 1 comment

Comments

@dotnetjunkie
Copy link
Collaborator

To prevent polluting the default Simple Injector API, the Container class overrides ToString, GetHashCode, Equals, and GetType and marks them with the [EditorBrowsable(EditorBrowsableState.Never)] attribute. This prevents users from seeing these methods in their IntelliSense list, while they are hardly ever useful when using the Container type. This practice has been in place for many years and works very well.

This practice, however, is useful for most types provides by Simple Injector, and might even be useful in Simple Injector's integration libraries.

For that reason, it would be good to introduce a common base class, e.g. ApiObject that implements the hiding of these four methods. This allows other object to inherit from that base class and prevents them from having to implement these overrides themselves.

@dotnetjunkie
Copy link
Collaborator Author

feature-689 branch created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant