0

I have Type of a property. propertyType is basically a

public abstract Type PropertyType { get; }

From this I want to know Object type which is Employee:

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

How can I get this?

3
  • What do you mean by this "From this I want to know Object type which is Employee." ? Apr 24, 2015 at 11:36
  • This?
    – Dion V.
    Apr 24, 2015 at 11:37
  • My property is of type public Employee[] {get; set;}. But I have property type value from which I want to know this property is of type Employee. Apr 24, 2015 at 11:39

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.