Class DynamicJacket
Case insensitive dynamic read-object for JSON.
Used in various cases where you start with JSON and want to
provide the contents to custom code without having to mess with
JS/C# code style differences.
You will usually do things like AsDynamic(jsonString).FirstName
etc.
[InternalApi_DoNotUse_MayChangeWithoutNotice("just use the objects from AsDynamic(...), don't use this directly")]
[JsonConverter(typeof(DynamicJsonConverter))]
public class DynamicJacket : DynamicJacketBase<JsonObject>, IDynamicMetaObjectProvider, IReadOnlyList<object>, IReadOnlyCollection<object>, IEnumerable<object>, IEnumerable
- Inheritance
-
DynamicJacket
- Implements
- Inherited Members
Properties
Count
Count array items or object properties
public override int Count { get; }
Property Value
IsList
Check if it's an array.
public override bool IsList { get; }
Property Value
- bool
True if an array/list, false if an object.
this[int]
Not yet implemented accessor - must be implemented by the inheriting class.
public override object this[int index] { get; }
Parameters
index
int
Property Value
this[string]
Access the properties of this object.
public object this[string key] { get; }
Parameters
key
stringthe key, case-insensitive
Property Value
- object
A value (string, int etc.), DynamicJacket or DynamicJacketList
Remarks
Note that this accessor is case insensitive
Methods
GetEnumerator()
Enable enumeration. When going through objects (properties) it will return the keys, not the values.
Use the [key] accessor to get the values as DynamicJacketList or ToSic.Sxc.Data
[InternalApi_DoNotUse_MayChangeWithoutNotice]
public override IEnumerator<object> GetEnumerator()
Returns
TryGetMember(GetMemberBinder, out object)
Performs a case-insensitive value look-up
public override bool TryGetMember(GetMemberBinder binder, out object result)
Parameters
binder
GetMemberBinder.net binder object
result
objectusually a DynamicJacket, DynamicJacketList or null
Returns
- bool
always returns true, to avoid errors