Search Results for

    Show / Hide Table of Contents
    note

    VeloxDB is still in beta and APIs are subject to change. We are in the process of completing the documentation, so some sections may be incomplete or empty at this time.

    Class SortedIndexReader<T, TKey1>

    Reader for a single property sorted index. Use this class to lookup a DatabaseObject using sorted index.

    Inheritance
    object
    SortedIndexReader<T, TKey1>
    Inherited Members
    object.GetType()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: VeloxDB.ObjectInterface
    Assembly: vlxdb.dll
    Syntax
    public sealed class SortedIndexReader<T, TKey1> where T : DatabaseObject
    Type Parameters
    Name Description
    T

    Type of DatabaseObject being looked up.

    TKey1

    Type of the key property.

    Methods

    GetAfter(TKey1, ScanDirection)

    Searches the sorted index using the condition key1 > keyProperty1. Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.

    Declaration
    public IEnumerable<T> GetAfter(TKey1 key1, ScanDirection scanDirection)
    Parameters
    Type Name Description
    TKey1 key1

    The value of the key property.

    ScanDirection scanDirection

    Indicates a direction in which to scan the index.

    Returns
    Type Description
    IEnumerable<T>

    All objects from the index that satisfy the required condition.

    Exceptions
    Type Condition
    ObjectDisposedException

    If ObjectModel has been disposed.

    GetAfterOrEqual(TKey1, ScanDirection)

    Searches the sorted index using the condition key1 <= keyProperty1. Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.

    Declaration
    public IEnumerable<T> GetAfterOrEqual(TKey1 key1, ScanDirection scanDirection)
    Parameters
    Type Name Description
    TKey1 key1

    The value of the key property.

    ScanDirection scanDirection

    Indicates a direction in which to scan the index.

    Returns
    Type Description
    IEnumerable<T>

    All objects from the index that satisfy the required condition.

    Exceptions
    Type Condition
    ObjectDisposedException

    If ObjectModel has been disposed.

    GetBefore(TKey1, ScanDirection)

    Searches the sorted index using the condition key1 < keyProperty1. Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.

    Declaration
    public IEnumerable<T> GetBefore(TKey1 key1, ScanDirection scanDirection)
    Parameters
    Type Name Description
    TKey1 key1

    The value of the key property.

    ScanDirection scanDirection

    Indicates a direction in which to scan the index.

    Returns
    Type Description
    IEnumerable<T>

    All objects from the index that satisfy the required condition.

    Exceptions
    Type Condition
    ObjectDisposedException

    If ObjectModel has been disposed.

    GetBeforeOrEqual(TKey1, ScanDirection)

    Searches the sorted index using the condition key1 <= keyProperty1. Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.

    Declaration
    public IEnumerable<T> GetBeforeOrEqual(TKey1 key1, ScanDirection scanDirection)
    Parameters
    Type Name Description
    TKey1 key1

    The value of the key property.

    ScanDirection scanDirection

    Indicates a direction in which to scan the index.

    Returns
    Type Description
    IEnumerable<T>

    All objects from the index that satisfy the required condition.

    Exceptions
    Type Condition
    ObjectDisposedException

    If ObjectModel has been disposed.

    GetEntireRange(ScanDirection)

    Returns all the objects in the index.

    Declaration
    public IEnumerable<T> GetEntireRange(ScanDirection scanDirection)
    Parameters
    Type Name Description
    ScanDirection scanDirection

    Indicates a direction in which to scan the index.

    Returns
    Type Description
    IEnumerable<T>

    All objects from the index that satisfy the required condition.

    Exceptions
    Type Condition
    ObjectDisposedException

    If ObjectModel has been disposed.

    GetEqual(TKey1)

    Searches the sorted index using the condition key1 = keyProperty1. This method returns at most a single object with a given key and is ideal for querying unique indexes.

    Declaration
    public T GetEqual(TKey1 key1)
    Parameters
    Type Name Description
    TKey1 key1

    The value of the key property.

    Returns
    Type Description
    T

    An object with a given key, if one exists, null otherwise.

    Exceptions
    Type Condition
    ObjectDisposedException

    If ObjectModel has been disposed.

    GetEqual(TKey1, ScanDirection)

    Searches the sorted index using the condition key1 = keyProperty1.

    Declaration
    public IEnumerable<T> GetEqual(TKey1 key1, ScanDirection scanDirection)
    Parameters
    Type Name Description
    TKey1 key1

    The value of the key property.

    ScanDirection scanDirection

    Indicates a direction in which to scan the index.

    Returns
    Type Description
    IEnumerable<T>

    All objects from the index that satisfy the required condition.

    Exceptions
    Type Condition
    ObjectDisposedException

    If ObjectModel has been disposed.

    GetRange(TKey1, bool, TKey1, bool, ScanDirection)

    Returns all the objects in the index that belong to the given interval.

    Declaration
    public IEnumerable<T> GetRange(TKey1 startKey1, bool isStartOpen, TKey1 endKey1, bool isEndOpen, ScanDirection scanDirection)
    Parameters
    Type Name Description
    TKey1 startKey1

    The value of the key property for the range start.

    bool isStartOpen

    Indicates whether the start side of the interval is open or closed.

    TKey1 endKey1

    The value of the key property for the range end.

    bool isEndOpen

    Indicates whether the end side of the interval is open or closed.

    ScanDirection scanDirection

    Indicates a direction in which to scan the index.

    Returns
    Type Description
    IEnumerable<T>

    All objects from the index that satisfy the required condition.

    Exceptions
    Type Condition
    ObjectDisposedException

    If ObjectModel has been disposed.

    See Also

    VeloxDB The definitive guide: Sorted indexes
    SortedIndexAttribute
    GetSortedIndex<T, TKey1>(string)
    In this article
    © 2025 Copyright: VeloxDB