c# - Getting actual type from generic type -
i'm wondering if possible. have generic class looks so:
public class someclass<t> : someinterface { public someclass() { var somevariable = new otherclass("string_parameter"); } } what i'd use generic parameter in otherclass constructor, sort of otherclass(t.gettype().tostring()) having no luck. i'm after possible, or can not @ t parameter in fashion?
you're looking typeof(t).name
Comments
Post a Comment