简体   繁体   English

从PropertyType获取对象类型?

[英]Get Object type from PropertyType?

I have Type of a property. 我有一个属性类型。 propertyType is basically a propertyType基本上是一个

public abstract Type PropertyType { get; }

From this I want to know Object type which is Employee : 由此我想知道Employee对象类型:

propertyType    {Name = "Employee[]"  FullName = "DataContract.Employee[]"}

How can I get this? 我怎么能得到这个?

Type t;
if (propertyType.IsArray) // true
   t = propertyType.GetElementType(); // t = Employee

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM