Appearance
GetProperty Method
Definition
- Namespace:
JASE.Extensions - Assembly:
JASE.dll
Overloads
| Name | Description |
|---|---|
T GetProperty(ExpandoObject eo, string key) | Retrieves the value of a property from an ExpandoObject using the specified key. Returns the value cast to the specified type, or default if not found or type mismatch. |
object GetProperty(T obj, string name) | Retrieves the value of a property from either a POCO or an ExpandoObject using the specified name. |
T GetProperty(ExpandoObject eo, string key)
csharp
T GetProperty(ExpandoObject eo, string key)Retrieves the value of a property from an ExpandoObject using the specified key. Returns the value cast to the specified type, or default if not found or type mismatch.
Type parameters
| Name | Description |
|---|---|
T | The expected type of the property value. |
Parameters
| Name | Description |
|---|---|
eo | The ExpandoObject instance. |
key | The name of the property to retrieve. |
Returns
The property value if present and of type T; otherwise, default.
object GetProperty(T obj, string name)
csharp
object GetProperty(T obj, string name)Retrieves the value of a property from either a POCO or an ExpandoObject using the specified name.
Type parameters
| Name | Description |
|---|---|
T | The type of the object. |
Parameters
| Name | Description |
|---|---|
name | The name of the property to retrieve. |
obj | The object instance (POCO or ExpandoObject). |
Returns
The value of the property, or null if not found.