KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I was hoping to do something like this, but it appears to be illegal in C#: public Collection MethodThatFetchesSomething<T>() where T : SomeBaseClass { return T.StaticMethodOnSomeBaseClassThatReturnsCollection(); } I get a compile-time error: 'T' is a 'type parameter', which is not valid in the given context. Given a generic type parameter, how can I call a static method on the generic class? The static method has to be available, given the constraint.
Tags (comma-separated)
Save Edits
Cancel