• Basics
  • Abyss
  • Web APIs
  • C# & Razor
  • .net API
  • JS & TS API

    Show / Hide Table of Contents

    Interface IMetadataOf

    A provider for metadata for something. So if an IEntity or an App has metadata, this will provide it.

    Inherited Members
    System.Collections.Generic.IEnumerable<ToSic.Eav.Data.IEntity>.GetEnumerator()
    IHasPermissions.Permissions
    Namespace: ToSic.Eav.Metadata
    Assembly: ToSic.Eav.Core.dll
    Syntax
    [PublicApi_Stable_ForUseInYourCode]
    public interface IMetadataOf : IEnumerable<IEntity>, IEnumerable, IHasPermissions
    Remarks

    You can either loop through this object (since it's an IEnumerable) or ask for values of the metadata, no matter on what sub-entity the value is stored on.

    Properties

    | Improve this Doc View Source

    Target

    The identifier which was used to retrieve the Metadata. It can be used as an address for creating further Metadata for the same target.

    Declaration
    ITarget Target { get; }
    Property Value
    Type Description
    ITarget
    Remarks

    Added in v13

    Methods

    | Improve this Doc View Source

    GetBestValue<TVal>(String, String)

    Get the best matching value in ALL the metadata items.

    Declaration
    TVal GetBestValue<TVal>(string name, string typeName = null)
    Parameters
    Type Name Description
    System.String name

    attribute name we're looking for

    System.String typeName

    optional type-name, if provided, will only look at metadata of that type; otherwise (or if null) will look at all metadata items and pick first match

    Returns
    Type Description
    TVal

    A typed value.

    Type Parameters
    Name Description
    TVal

    expected type, like string, int etc.

    | Improve this Doc View Source

    GetBestValue<TVal>(String, String[])

    Get the best matching value in the metadata items.

    Declaration
    TVal GetBestValue<TVal>(string name, string[] typeNames)
    Parameters
    Type Name Description
    System.String name

    attribute name we're looking for

    System.String[] typeNames

    list of type-name in the order to check. if one of the values is null, it will then check all items no matter what type

    Returns
    Type Description
    TVal

    A typed value.

    Type Parameters
    Name Description
    TVal

    expected type, like string, int etc.

    | Improve this Doc View Source

    HasType(String)

    Determine if something has metadata of the specified type

    Declaration
    bool HasType(string typeName)
    Parameters
    Type Name Description
    System.String typeName

    Type Name

    Returns
    Type Description
    System.Boolean

    True if there is at least one item of this type

    Remarks

    Added in v13

    | Improve this Doc View Source

    OfType(String)

    Get all Metadata items of a specific type

    Declaration
    IEnumerable<IEntity> OfType(string typeName)
    Parameters
    Type Name Description
    System.String typeName

    Type Name

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<IEntity>
    Remarks

    Added in v13

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX