© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
166 replies
Silva

✅ Receiving any instance of a generic class in a method, no matter what the generic type is.

Title, how can I allow for a method to receive any instance of a generic class, no matter what the generic type is.
So a method that could receive both Generic<int> and Generic<string>.
Doing public void MyMethod(Generic param) doesn't work
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

❔ generic class in generic method
C#CC# / help
3y ago
❔ Check What Generic Type a Class Implements
C#CC# / help
4y ago
✅ Get type of current instance in a static method
C#CC# / help
2y ago
❔ giving current class type to a generic class
C#CC# / help
3y ago