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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -