Table of Contents

Interface IMetadata

Namespace
ToSic.Sxc.Data
Assembly
ToSic.Sxc.dll

Metadata on Dynamic Objects - like IDynamicEntity or IAsset (files/folders).

Behaves like a normal DynamicEntity, but has additional commands to detect if specific Metadata exists.

[PublicApi]
public interface IMetadata : IHasMetadata, ITypedItem, ITyped, IEquatable<ITypedItem>, ICanDebug, IHasDecorators<IEntity>
Inherited Members

Remarks

  • Added in v13
  • Made compatible to ITypedItem in 16.02 to allow typed commands such as .String(...)
  • Renamed in v16.02 from IDynamicMetadata to IMetadata since it's not necessarily dynamic any more (but still supports dynamic where needed) Note that this is a breaking change, but we believe the type is never directly mentioned in any code

Methods

HasType(string)

Ask if there is metadata of the type specified. This is important in scenarios where an item could have a lot of metadata, but we only want one specific type to look at.

bool HasType(string type)

Parameters

type string

Returns

bool

true if metadata of that type exists

OfType(string)

Get all the metadata Entities of a specific type.

IEnumerable<IEntity> OfType(string type)

Parameters

type string

Returns

IEnumerable<IEntity>