Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass<T>
- public class Boy
- public class Girl
- var myObject=new MyClass<Boy>();
- bool test = myObject.GetType() == typeof(MyClass<>);//test variable should be true but it's false
- var myObject = new MyClass<Boy>();
- bool test = myObject.GetType().GetGenericTypeDefinition() == typeof(MyClass<>);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement