【发布时间】:2012-05-08 05:54:31
【问题描述】:
什么是反射等价物:
default(object); //null
当我直到运行时才知道类型时,例如
public void Method(Type type)
{
var instance = type.CreateDefault(); //no such method exists, but I expect there is a way of doing this?
}
【问题讨论】:
标签: c# .net reflection