Class Metadata
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Syntax
public static class Metadata
Methods
From(params object[])
Creates a metadata dictionary from a layer or a set of layers.
Declaration
public static IDictionary<string, object> From(params object[] layers)
Parameters
object[]
layers
Objects containing data for respective layers |
Returns
IDictionary<string, object>
Metadata dictionary that can be used in a Metadata property of various contracts, e.g. ContentCreateRequest |
Remarks
Layer names (schema IDs) will be determined by schema ID defined in PictureparkSchemaAttribute on the layer class (if applied) or the name of the type. For use with anonymous classes, please use the From(string, object) overload.
From(string, object)
Creates a metadata dictionary from a layer. Usually used if the layer object is an anonymous object or a dictionary.
Declaration
public static IDictionary<string, object> From(string layerName, object layer)
Parameters
string
layerName
Schema ID of the layer schema |
object
layer
Object containing data of the layer |
Returns
IDictionary<string, object>
Metadata dictionary that can be used in a Metadata property of various contracts, e.g. ContentCreateRequest |
ResolveLayerKey(Type)
Resolves layer key for metadata dictionary based on either the ID defined in PictureparkSchemaAttribute (if applied on the type) or based on type name.
Declaration
public static string ResolveLayerKey(Type layerType)
Parameters
Type
layerType
Type for which to resolve layer key |
Returns
string
Resolved layer key |
ResolveSchemaId(object)
Resolves schema ID based on either the ID defined in PictureparkSchemaAttribute (if applied on the type) or based on type name.
Declaration
public static string ResolveSchemaId(object obj)
Parameters
object
obj
Object for which to resolve schema ID |
Returns
string
Resolved schema ID |
ResolveSchemaId(Type)
Resolves schema ID based on either the ID defined in PictureparkSchemaAttribute (if applied on the type) or based on type name.
Declaration
public static string ResolveSchemaId(Type type)
Parameters
Type
type
Type for which to resolve schema ID |
Returns
string
Resolved schema ID |
Update<T, TProperty>(Expression<Func<T, TProperty>>, TProperty)
Creates a metadata dictionary for a use in a metadata update scenario.
Declaration
public static IDictionary<string, object> Update<T, TProperty>(Expression<Func<T, TProperty>> property, TProperty newValue)
Parameters
Expression<Func<T, TProperty>>
property
The property on the object (schema field) you want to update |
TProperty
newValue
New value you want to update the schema field to |
Returns
IDictionary<string, object>
Metadata dictionary that can be used in a Metadata property of update contracts, e.g. ContentMetadataUpdateRequest |
Type Parameters
T |
TProperty |
Remarks
Layer name (schema ID) will be determined by schema ID defined in PictureparkSchemaAttribute on the layer class (if applied) or the name of the type. Anonymous classes are naturally not supported.