If(T == type of(MyClass)) { This.Data.Add( new T() { // and depending on my class I populate different properties here. }); else { // and so on }