Class ReflectionObjectValueProvider
Implementation of IGetsValueFromObject which uses reflection to get values from public properties, methods or fields of objects.
Inheritance
Implements
Inherited Members
Namespace: ZptSharp.Expressions.PathExpressions
Assembly: ZptSharp.dll
Syntax
public class ReflectionObjectValueProvider : IGetsValueFromObject
Constructors
| Improve this Doc View SourceReflectionObjectValueProvider(IGetsValueFromObject, IGetsValueFromReflection)
Initializes a new instance of the ReflectionObjectValueProvider class.
Declaration
public ReflectionObjectValueProvider(IGetsValueFromObject wrapped, IGetsValueFromReflection valueProvider)
Parameters
Type | Name | Description |
---|---|---|
IGetsValueFromObject | wrapped | The wrapped service. |
IGetsValueFromReflection | valueProvider | The reflection value provider |
Methods
| Improve this Doc View SourceTryGetValueAsync(String, Object, CancellationToken)
Attempts to get a value for a named reference, from the specified object.
This will return a value by using the getter of a property, or by executing a method (which takes no parameters) or by accessing a field (checking for members in this same order). Only public members will be considered.
Declaration
public Task<GetValueResult> TryGetValueAsync(string name, object object, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The value name. |
System.Object | object | The object from which to retrieve the value. |
System.Threading.CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<GetValueResult> | An object indicating whether a value was successfully retrieved or not, along with the retrieved value (if applicable). |