Esempio n. 1
0
        public static void SetPropertyValue(this object entity, string propertyName, object value)
        {
            PropertyInfo property = PropertyFactory.GetPropertyInfo(entity.GetType(), propertyName);

            if (property != null)
            {
                property.SetValue(entity, value.ConvertTo(property.PropertyType), null);
            }
        }
Esempio n. 2
0
        public static object GetPropertyValue(this object entity, string propertyName)
        {
            PropertyInfo property = PropertyFactory.GetPropertyInfo(entity.GetType(), propertyName);

            if (property != null)
            {
                return(property.GetValue(entity, null));
            }
            return(null);
        }