c# create an instance of a generic class code example Example: c# create instance from type T instance = Activator.CreateInstance<T>();