Create an instance of a Generic Type and invoke its method

suggest change
var baseType = typeof(List<>);
var genericType = baseType.MakeGenericType(typeof(String));
var instance = Activator.CreateInstance(genericType);
var method = genericType.GetMethod("GetHashCode");
var result = method.Invoke(instance, new object[] { });

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents