Class DynamicObjectValueProvider
A chain of responsibility class which get values from object that implement System.Dynamic.IDynamicMetaObjectProvider (IE: which are "dynamic objects"). If the object does not implement that interface then the call is delegated straight to the wrapped implementation.
Inheritance
Implements
Inherited Members
Namespace: ZptSharp.Expressions.PathExpressions
Assembly: ZptSharp.dll
Syntax
public class DynamicObjectValueProvider : IGetsValueFromObject
Constructors
| Improve this Doc View SourceDynamicObjectValueProvider(IGetsValueFromObject)
Initializes a new instance of the DynamicObjectValueProvider class.
Declaration
public DynamicObjectValueProvider(IGetsValueFromObject wrapped)
Parameters
Type | Name | Description |
---|---|---|
IGetsValueFromObject | wrapped | Wrapped. |
Methods
| Improve this Doc View SourceTryGetValueAsync(String, Object, CancellationToken)
Attempts to get a value for a named reference, from the specified object.
If the object
is a dynamic object then an attempt will be made
to get a value based upon the name
. If the object
is not a dynamic object then the call will be delegated to the wrapped provider.
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). |