Example #1
0
        public static void SetPropertyValue(T entity, string propName, object value)
        {
            PropertyInfo propInfo   = entityType.GetProperty(propName);
            MethodInfo   method     = propInfo.GetGetMethod();
            Type         returnType = method.ReturnType;

            value = TypeConvert.ChangeType(value, returnType);
            PropertyHelper.SetPropertyValue(entity, propName, value);
        }
Example #2
0
 public static T ChangeType <T>(object value)
 {
     return((T)TypeConvert.ChangeType(value, typeof(T)));
 }