Explain with an example how to create and consume a Generic type.
public static object CreateMethod(Type generic, Type innerType, params object[] args)
{
System.Type type = generic.MakeGenericType(new System.Type[] { innerType });
return Activator.CreateInstance(type, args);
}
To use it:
CreateMethod(typeof(List<>), typeof(string));