我正在尝试这样做:
Type type = Type.GetType(string.Format("Gestor.Data.Entities.{0}, Gestor.Data", e.Item.Value));
MetaDataUtil.GetColumnasGrid<type>();
Run Code Online (Sandbox Code Playgroud)
但它不起作用,你知道我怎么能这样做吗?
Der*_*ger 17
你需要使用反射.
var method =
typeof(MetaDataUtil)
.GetMethod("GetColumnasGrid")
.MakeGenericMethod(new [] { type })
.Invoke(null, null);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4537 次 |
| 最近记录: |