bin*_*eol 4 c# generics namespaces
我有一个我指定为某种类型的方法.
例如
public MyLabels GetLabels<T>()
{
// I'd like to get the namespace of the type that T represents here
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
typeof(T).FullName // namespace and class name
typeof(T).Namespace // namespace, no class name
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1387 次 |
| 最近记录: |