D
David
I posted a question that made very little sense. Basically, my class has a
reference type as one of its property. For example
- Employee class has a perperty called Name
- Name is a class with string properties - FirstName, LastName, MiddleName,
MaindenName, etc.
- To get to the employee's FirstName, it would be employee.Name.FirstName
At run time, I have the string path to the properties of name
("Name.FirstName", "Name.LastName"); Given an instance of Employee, I
would like to be able to check the values of first and last name.
I know this won't work.
Type type = Type.GetType("Employee");
PropertyInfo pinfo = type.GetProperty("Name.FirstName");
At run time, all I have are the two strings - "Employee" and
"Name.FirstName" (won't go into details as to why I am doing it this way,
but basically I am checking to make sure values of required fields have been
filled out using the list of required fields from a table), and an instance
of Employee. I need to be able to get the value of "Name.FirstName".
reference type as one of its property. For example
- Employee class has a perperty called Name
- Name is a class with string properties - FirstName, LastName, MiddleName,
MaindenName, etc.
- To get to the employee's FirstName, it would be employee.Name.FirstName
At run time, I have the string path to the properties of name
("Name.FirstName", "Name.LastName"); Given an instance of Employee, I
would like to be able to check the values of first and last name.
I know this won't work.
Type type = Type.GetType("Employee");
PropertyInfo pinfo = type.GetProperty("Name.FirstName");
At run time, all I have are the two strings - "Employee" and
"Name.FirstName" (won't go into details as to why I am doing it this way,
but basically I am checking to make sure values of required fields have been
filled out using the list of required fields from a table), and an instance
of Employee. I need to be able to get the value of "Name.FirstName".