Class LazyExpando
Expando class for evaluating the internal values on demand.
Inherited Members
Namespace: Kephas.Dynamic
Assembly: Kephas.Core.dll
Syntax
public class LazyExpando : Expando, IExpando, IDynamicMetaObjectProvider, IIndexable
Constructors
| Improve this Doc View SourceLazyExpando(IDictionary<String, Object>, Func<String, Object>)
Initializes a new instance of the LazyExpando class.
Declaration
public LazyExpando(IDictionary<string, object> dictionary, Func<string, object> valueResolver = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.Object> | dictionary | The dictionary. |
System.Func<System.String, System.Object> | valueResolver | The value resolver (optional). |
LazyExpando(Func<String, Object>)
Initializes a new instance of the LazyExpando class.
Declaration
public LazyExpando(Func<string, object> valueResolver = null)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.String, System.Object> | valueResolver | The value resolver (optional). |
Properties
| Improve this Doc View SourceValueResolver
Gets or sets the value resolver.
Declaration
protected Func<string, object> ValueResolver { get; set; }
Property Value
Type | Description |
---|---|
System.Func<System.String, System.Object> | The value resolver. |
Methods
| Improve this Doc View SourceHandleCircularDependency(String, out Object)
Handles the circular dependency described by requested key.
Declaration
protected virtual bool HandleCircularDependency(string key, out object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key involved in the circular dependency. |
System.Object | value | The value to return. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryGetValue(String, out Object)
Attempts to get the dynamic value with the given key.
Declaration
protected override bool TryGetValue(string key, out object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Object | value | The value to get. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Remarks
First of all, it is tried to get a property value from the inner object, if one is set. The next try is to retrieve the property value from the expando object itself. Lastly, if still a property by the provided name cannot be found, the inner dictionary is searched by the provided key.