Class IntegerKeyedDictionaryValueProvider
A chain of responsibility class which get values from any objects which implement any form of
IDictionary<int,T>
. If they implement a dictionary of integer and 'any type' then
we may read values from them based upon their numeric keys.
Inheritance
Implements
Inherited Members
Namespace: ZptSharp.Expressions.PathExpressions
Assembly: ZptSharp.dll
Syntax
public class IntegerKeyedDictionaryValueProvider : IGetsValueFromObject
Constructors
| Improve this Doc View SourceIntegerKeyedDictionaryValueProvider(IGetsValueFromObject)
Initializes a new instance of the StringKeyedDictionaryValueProvider class.
Declaration
public IntegerKeyedDictionaryValueProvider(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.
This will read a named value from that object if it implements a suitable
generic dictionary interface and contains a key matching the name
.
If either the object does not implement any dictionary interfaces keyed by integer, or
does not contain a key matching the name, then the call is delegated to the wrapped
service.
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). |