public static bool SetValue <DataType>(this Object Item, String PropertyName, DataType Value) { var lProperty = GetProperty(Item, PropertyName); if (lProperty != null) { var lType1 = lProperty.PropertyType; var lType2 = typeof(DataType); if (lType1.Equals(lType2) || MyTypeHelper.Is(lType2, lType1)) { lProperty.SetValue(Item, Value, null); } else { var lNewValue = MyTypeHelper.ConvertTo(Value, lType1); lProperty.SetValue(Item, lNewValue, null); } return(true); } return(false); }