logo
logo
  • Interface IRelation

    Base interface for relations.

    Namespace: Stylelabs.M.Sdk.Contracts.Base
    Assembly: Stylelabs.M.Sdk.dll
    Syntax
    public interface IRelation : IMember, IDirtyTracking

    Properties

    Role

    The role of this instance in the relation.

    Declaration
    RelationRole Role { get; }
    Property Value
    Type Description
    RelationRole

    Methods

    Clear()

    Clears the value(s) of the relation.

    Declaration
    void Clear()

    GetIds()

    This utility method allows getting the value of any type of relation.

    In case of an IToManyRelation the result will contain all ids on the relation.

    In case of an IToOneRelation the list can contain 1 id (maximum) if an id was set on the relation. If no id was set on the relation, an empty list is returned.

    Declaration
    IList<long> GetIds()
    Returns
    Type Description
    IList<System.Int64>

    A list of ids (never null).

    SetIds(IEnumerable<Int64>)

    Sets the ids on the relations values. The values should be strictly positive.

    In case of an IToManyRelation, the list of ids will be set on the relation.

    In case of an IToOneRelation, ids can have at most one value. If the list is empty then the value will be set to null.

    Declaration
    void SetIds(IEnumerable<long> ids)
    Parameters
    Type Name Description
    IEnumerable<System.Int64> ids

    Ids

    Can we improve this article ? Provide feedback