Appearance
SetValue Method
Definition
- Namespace:
JASE - Assembly:
JASE.ReflectionTools.dll
bool SetValue(object obj, string property, object value, bool caseSensitivePropName = null)
csharp
bool SetValue(object obj, string property, object value, bool caseSensitivePropName = null)Sets the value of a specified property on the provided object using reflection. Supports nested property paths (e.g., "User.Address.Street") and automatic instantiation of null objects or arrays.
Parameters
| Name | Description |
|---|---|
caseSensitivePropName | If false, performs a case-insensitive property lookup. |
obj | The object instance to modify. |
property | The property name to set. Supports dotted paths to access nested properties (e.g., "User.Profile.Name"). |
value | The value to assign to the property. Automatically converted if types differ. |
Returns
True if the value was successfully assigned.