samedi 26 décembre 2015

how to access sub class properties of object.GetType() when only have the name of the sub class as a string

I'm trying to assemble a generic method which is passed an object of a class type (ie: dbJob) and also the name of a sub class like 'LastUpdatedDate' and a process string, which can be '> 01-01-2015'.

The method looks like this

public bool checkProcess(object obj, string className, string processStr)
{
    PropertyInfo[] propertyInfo;
    bool returnValue = false;
    propertyInfo = obj.GetType().GetProperties();
    //propertyInfo className evaluate processStr
    return returnValue; 
} 

I'm using Reflection to get the property information for my Class. Say I'm passing dbJob, how can I use the string say 'LastUpdatedDate' for the sub class to get me the properties to evaluate processStr?





Aucun commentaire:

Enregistrer un commentaire