Search Results for

    Show / Hide Table of Contents

    Struct LTree

    Represents a PostgreSQL ltree type. This type is implicitly convertible to a .NET .

    Implements
    IEquatable<><LTree>
    Namespace: Microsoft.EntityFrameworkCore
    Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.dll
    Syntax
    public readonly struct LTree : IEquatable<LTree>
    Remarks

    See https://www.postgresql.org/docs/current/ltree.html

    Constructors

    | Improve this Doc View Source

    LTree(string)

    Constructs a new instance of LTree.

    Declaration
    public LTree(string value)
    Parameters
    Type Name Description
    string value

    The string value for the ltree.

    Remarks

    See https://www.postgresql.org/docs/current/ltree.html

    Properties

    | Improve this Doc View Source

    NLevel

    Returns number of labels in path.

    Declaration
    public int NLevel { get; }
    Property Value
    Type Description
    int
    Remarks

    The property is translated to nlevel(ltree).

    See https://www.postgresql.org/docs/current/ltree.html

    Methods

    | Improve this Doc View Source

    Equals(LTree)

    Declaration
    public bool Equals(LTree other)
    Parameters
    Type Name Description
    LTree other
    Returns
    Type Description
    bool
    Remarks

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    Equals(object?)

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object? obj
    Returns
    Type Description
    bool
    Remarks

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Remarks

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    Index(LTree, int)

    Returns position of first occurrence of other in this ltree, or -1 if not found. The search starts at position offset; negative offset means start -offset labels from the end of the path.

    Declaration
    public int Index(LTree other, int offset)
    Parameters
    Type Name Description
    LTree other
    int offset
    Returns
    Type Description
    int
    Remarks

    The method call is translated to index(ltree1, ltree2, offset).

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    Index(LTree)

    Returns position of first occurrence of other in this ltree, or -1 if not found.

    Declaration
    public int Index(LTree other)
    Parameters
    Type Name Description
    LTree other
    Returns
    Type Description
    int
    Remarks

    The method call is translated to index(ltree1, ltree2).

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    IsAncestorOf(LTree)

    Returns whether this ltree is an ancestor of other (or equal).

    Declaration
    public bool IsAncestorOf(LTree other)
    Parameters
    Type Name Description
    LTree other
    Returns
    Type Description
    bool
    Remarks

    The method call is translated to left @> right.

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    IsDescendantOf(LTree)

    Returns whether this ltree is a descendant of other (or equal).

    Declaration
    public bool IsDescendantOf(LTree other)
    Parameters
    Type Name Description
    LTree other
    Returns
    Type Description
    bool
    Remarks

    The method call is translated to left <@ right.

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    LongestCommonAncestor(params LTree[])

    Computes longest common ancestor of paths.

    Declaration
    public static LTree LongestCommonAncestor(params LTree[] others)
    Parameters
    Type Name Description
    LTree[] others
    Returns
    Type Description
    LTree
    Remarks

    The method call is translated to lca(others).

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    MatchesLQuery(string)

    Returns whether this ltree matches lquery.

    Declaration
    public bool MatchesLQuery(string lquery)
    Parameters
    Type Name Description
    string lquery
    Returns
    Type Description
    bool
    Remarks

    The method call is translated to left ~ right.

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    MatchesLTxtQuery(string)

    Returns whether this ltree matches ltxtquery.

    Declaration
    public bool MatchesLTxtQuery(string ltxtquery)
    Parameters
    Type Name Description
    string ltxtquery
    Returns
    Type Description
    bool
    Remarks

    The method call is translated to left @ right.

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    Subpath(int, int)

    Returns subpath of this ltree starting at position offset, with length len. If offset is negative, subpath starts that far from the end of the path. If len is negative, leaves that many labels off the end of the path.

    Declaration
    public LTree Subpath(int offset, int len)
    Parameters
    Type Name Description
    int offset
    int len
    Returns
    Type Description
    LTree
    Remarks

    The method call is translated to subpath(ltree, offset, len).

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    Subpath(int)

    Returns subpath of ltree starting at position offset, extending to end of path. If offset is negative, subpath starts that far from the end of the path.

    Declaration
    public LTree Subpath(int offset)
    Parameters
    Type Name Description
    int offset
    Returns
    Type Description
    LTree
    Remarks

    The method call is translated to subpath(ltree, offset).

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    Subtree(int, int)

    Returns subpath of this ltree from position start to position end-1 (counting from 0).

    Declaration
    public LTree Subtree(int start, int end)
    Parameters
    Type Name Description
    int start
    int end
    Returns
    Type Description
    LTree
    Remarks

    The method call is translated to subltree(ltree, start, end).

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Remarks

    See https://www.postgresql.org/docs/current/ltree.html

    Operators

    | Improve this Doc View Source

    operator ==(LTree, LTree)

    Compares two LTree instances for equality.

    Declaration
    public static bool operator ==(LTree x, LTree y)
    Parameters
    Type Name Description
    LTree x
    LTree y
    Returns
    Type Description
    bool
    Remarks

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    implicit operator string(LTree)

    Converts a string to an LTree type.

    Declaration
    public static implicit operator string(LTree ltree)
    Parameters
    Type Name Description
    LTree ltree
    Returns
    Type Description
    string
    Remarks

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    implicit operator LTree(string)

    Converts an LTree type to a string.

    Declaration
    public static implicit operator LTree(string value)
    Parameters
    Type Name Description
    string value
    Returns
    Type Description
    LTree
    Remarks

    See https://www.postgresql.org/docs/current/ltree.html

    | Improve this Doc View Source

    operator !=(LTree, LTree)

    Compares two LTree instances for inequality.

    Declaration
    public static bool operator !=(LTree x, LTree y)
    Parameters
    Type Name Description
    LTree x
    LTree y
    Returns
    Type Description
    bool
    Remarks

    See https://www.postgresql.org/docs/current/ltree.html

    Implements

    IEquatable<>
    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright 2023 The Npgsql Development Team