Reputation: 1603
I'm wondering if this is possible. I have a generic class that looks like so:
public class SomeClass<T> : SomeInterface
{
public SomeClass()
{
var someVariable = new OtherClass("string_parameter");
}
}
What I'd like to do is use that generic parameter in my OtherClass
constructor, sort of like OtherClass(T.GetType().ToString())
but am having no luck. Is what I'm after possible, or can I not get at the T
parameter in that fashion?
Upvotes: 0
Views: 57