Class RecursivePropertyAccessor
- Namespace
- CMS.Plugin.FlowManagement.Abstractions.FlowBusiness
- Assembly
- CMS.Plugin.FlowManagement.Abstractions.dll
递归获取多级嵌套属性的值
public class RecursivePropertyAccessor
- Inheritance
-
RecursivePropertyAccessor
- Inherited Members
Methods
GetNthElement(object, int)
Gets the NTH element.
public static object GetNthElement(object obj, int n)
Parameters
Returns
GetPropertyValue(object, string, int?)
Gets the property value.
public static object GetPropertyValue(object source, string propertyPath, int? dataIndex = null)
Parameters
Returns
Exceptions
- ArgumentNullException
source
- ArgumentException
Property path is empty. - propertyPath or Property '{propertyName}' not found on type '{currentValue.GetType().Name}'.
- InvalidOperationException
Property '{propertyName}' returned null, cannot access further properties.
GetPropertyValue(object, string[], int?)
Gets the property value.
public static object GetPropertyValue(object source, string[] properties, int? dataIndex = null)
Parameters
Returns
Exceptions
- ArgumentNullException
source
- ArgumentException
Property path is null. - properties or Property '{propertyName}' not found on type '{currentValue.GetType().Name}'.
- InvalidOperationException
Property '{propertyName}' returned null, cannot access further properties.