Search Results for

    Show / Hide Table of Contents

    Struct KeyPath

    Represents a key path that can be used as a part of a KeyPathsCollection when subscribing for notifications. A KeyPath can be implicitly built from a string, where the string is the name of a property (e.g "FirstName"), eventually dotted to indicated nested properties. (e.g "Dog.Name"). Wildcards can also be used in key paths to capture all properties at a given level (e.g "", "Friends." or "*.FirstName"). A KeyPath can also be built using the ForExpression<T>(Expression<Func<T, object?>>) method, that creates the KeyPath corresponding to the property path represented by the input expression.

    Inherited Members
    ValueType.ToString()
    Namespace: Realms
    Assembly: Realm.dll
    Syntax
    public readonly struct KeyPath

    Methods

    | Edit this page View Source

    ForExpression<T>(Expression<Func<T, object?>>)

    Creates a KeyPath from an Expression that specifies a property path for a given realm object type.

    Declaration
    public static KeyPath ForExpression<T>(Expression<Func<T, object?>> expression) where T : IRealmObject
    Parameters
    Type Name Description
    Expression<Func<T, object>> expression

    The expression specifying the path to the property.

    Returns
    Type Description
    KeyPath

    A KeyPath representing the full path to the specified property.

    Type Parameters
    Name Description
    T

    The type of the realm object..

    Examples
    var keyPath = KeyPath.For<Person>(p => p.Dog.Name);

    Operators

    | Edit this page View Source

    operator ==(KeyPath, KeyPath)

    Declaration
    public static bool operator ==(KeyPath left, KeyPath right)
    Parameters
    Type Name Description
    KeyPath left
    KeyPath right
    Returns
    Type Description
    bool
    | Edit this page View Source

    implicit operator KeyPath(string)

    Declaration
    public static implicit operator KeyPath(string s)
    Parameters
    Type Name Description
    string s
    Returns
    Type Description
    KeyPath
    | Edit this page View Source

    operator !=(KeyPath, KeyPath)

    Declaration
    public static bool operator !=(KeyPath left, KeyPath right)
    Parameters
    Type Name Description
    KeyPath left
    KeyPath right
    Returns
    Type Description
    bool
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2020-2024 Realm
    Generated by DocFX