Class JsonExpando
An expando object created from a JSON.
Inherited Members
Namespace: Kephas.Serialization.ServiceStack.Text
Assembly: Kephas.Serialization.ServiceStack.Text.dll
Syntax
public class JsonExpando : Expando, IExpando, IDynamicMetaObjectProvider, IIndexable
Constructors
| Improve this Doc View SourceJsonExpando(IDictionary<String, Object>)
Initializes a new instance of the JsonExpando class.
Declaration
public JsonExpando(IDictionary<string, object> jsonHash)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.Object> | jsonHash | The json hash. |
JsonExpando(String)
Initializes a new instance of the JsonExpando class.
Declaration
public JsonExpando(string json)
Parameters
Type | Name | Description |
---|---|---|
System.String | json | The JSON. |
Methods
| Improve this Doc View SourceToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string that represents the current object. |
Overrides
TryConvertToJsonExpando(Object)
Tries to convert the provided object to a JsonExpando.
Declaration
protected static object TryConvertToJsonExpando(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object. |
Returns
Type | Description |
---|---|
System.Object | A JsonExpando object, a list of JsonExpando objects, or the original object, if the object could not be converted. |
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.