Search Results for

    Show / Hide Table of Contents

    Class NpgsqlNodaTimeDbFunctionsExtensions

    Provides extension methods supporting NodaTime function translation for PostgreSQL.

    Inheritance
    object
    NpgsqlNodaTimeDbFunctionsExtensions
    Namespace: Microsoft.EntityFrameworkCore
    Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime.dll
    Syntax
    public static class NpgsqlNodaTimeDbFunctionsExtensions

    Methods

    | Improve this Doc View Source

    Average(DbFunctions, IEnumerable<Duration>)

    Computes the average (arithmetic mean) of the non-null input intervals. Corresponds to the PostgreSQL avg aggregate function.

    Declaration
    public static Duration? Average(this DbFunctions _, IEnumerable<Duration> input)
    Parameters
    Type Name Description
    DbFunctions _

    The instance.

    IEnumerable<><Duration> input

    The input values to be computed into an average.

    Returns
    Type Description
    Duration?
    See Also
    PostgreSQL documentation for aggregate functions.
    | Improve this Doc View Source

    Average(DbFunctions, IEnumerable<Period>)

    Computes the average (arithmetic mean) of the non-null input intervals. Corresponds to the PostgreSQL avg aggregate function.

    Declaration
    public static Period? Average(this DbFunctions _, IEnumerable<Period> input)
    Parameters
    Type Name Description
    DbFunctions _

    The instance.

    IEnumerable<><Period> input

    The input values to be computed into an average.

    Returns
    Type Description
    Period?
    See Also
    PostgreSQL documentation for aggregate functions.
    | Improve this Doc View Source

    Distance(DbFunctions, Instant, Instant)

    Returns the distance between two instants as a , particularly suitable for sorting where the appropriate index is defined.

    Declaration
    public static int Distance(this DbFunctions _, Instant a, Instant b)
    Parameters
    Type Name Description
    DbFunctions _
    Instant a
    Instant b
    Returns
    Type Description
    int
    Remarks

    This requires the btree_gist built-in PostgreSQL extension, see https://www.postgresql.org/docs/current/btree-gist.html.

    | Improve this Doc View Source

    Distance(DbFunctions, LocalDate, LocalDate)

    Returns the distance between two dates as a number of days, particularly suitable for sorting where the appropriate index is defined.

    Declaration
    public static int Distance(this DbFunctions _, LocalDate a, LocalDate b)
    Parameters
    Type Name Description
    DbFunctions _
    LocalDate a
    LocalDate b
    Returns
    Type Description
    int
    Remarks

    This requires the btree_gist built-in PostgreSQL extension, see https://www.postgresql.org/docs/current/btree-gist.html.

    | Improve this Doc View Source

    Distance(DbFunctions, LocalDateTime, LocalDateTime)

    Returns the distance between two local timestamps as a , particularly suitable for sorting where the appropriate index is defined.

    Declaration
    public static int Distance(this DbFunctions _, LocalDateTime a, LocalDateTime b)
    Parameters
    Type Name Description
    DbFunctions _
    LocalDateTime a
    LocalDateTime b
    Returns
    Type Description
    int
    Remarks

    This requires the btree_gist built-in PostgreSQL extension, see https://www.postgresql.org/docs/current/btree-gist.html.

    | Improve this Doc View Source

    Distance(DbFunctions, ZonedDateTime, ZonedDateTime)

    Returns the distance between two zoned timestamps as a , particularly suitable for sorting where the appropriate index is defined.

    Declaration
    public static int Distance(this DbFunctions _, ZonedDateTime a, ZonedDateTime b)
    Parameters
    Type Name Description
    DbFunctions _
    ZonedDateTime a
    ZonedDateTime b
    Returns
    Type Description
    int
    Remarks

    This requires the btree_gist built-in PostgreSQL extension, see https://www.postgresql.org/docs/current/btree-gist.html.

    | Improve this Doc View Source

    RangeAgg(DbFunctions, IEnumerable<DateInterval>)

    Computes the union of the non-null input date intervals. Corresponds to the PostgreSQL range_agg aggregate function.

    Declaration
    public static DateInterval[] RangeAgg(this DbFunctions _, IEnumerable<DateInterval> input)
    Parameters
    Type Name Description
    DbFunctions _

    The instance.

    IEnumerable<><DateInterval> input

    The date intervals to be aggregated via union into a multirange.

    Returns
    Type Description
    DateInterval[]
    See Also
    PostgreSQL documentation for aggregate functions.
    | Improve this Doc View Source

    RangeAgg(DbFunctions, IEnumerable<Interval>)

    Computes the union of the non-null input intervals. Corresponds to the PostgreSQL range_agg aggregate function.

    Declaration
    public static Interval[] RangeAgg(this DbFunctions _, IEnumerable<Interval> input)
    Parameters
    Type Name Description
    DbFunctions _

    The instance.

    IEnumerable<><Interval> input

    The intervals to be aggregated via union into a multirange.

    Returns
    Type Description
    Interval[]
    See Also
    PostgreSQL documentation for aggregate functions.
    | Improve this Doc View Source

    RangeIntersectAgg(DbFunctions, IEnumerable<DateInterval[]>)

    Computes the intersection of the non-null input date interval multiranges. Corresponds to the PostgreSQL range_intersect_agg aggregate function.

    Declaration
    public static DateInterval[] RangeIntersectAgg(this DbFunctions _, IEnumerable<DateInterval[]> input)
    Parameters
    Type Name Description
    DbFunctions _

    The instance.

    IEnumerable<><DateInterval[]> input

    The date intervals on which to perform the intersection operation.

    Returns
    Type Description
    DateInterval[]
    See Also
    PostgreSQL documentation for aggregate functions.
    | Improve this Doc View Source

    RangeIntersectAgg(DbFunctions, IEnumerable<DateInterval>)

    Computes the intersection of the non-null input date intervals. Corresponds to the PostgreSQL range_intersect_agg aggregate function.

    Declaration
    public static DateInterval RangeIntersectAgg(this DbFunctions _, IEnumerable<DateInterval> input)
    Parameters
    Type Name Description
    DbFunctions _

    The instance.

    IEnumerable<><DateInterval> input

    The date intervals on which to perform the intersection operation.

    Returns
    Type Description
    DateInterval
    See Also
    PostgreSQL documentation for aggregate functions.
    | Improve this Doc View Source

    RangeIntersectAgg(DbFunctions, IEnumerable<Interval[]>)

    Computes the intersection of the non-null input interval multiranges. Corresponds to the PostgreSQL range_intersect_agg aggregate function.

    Declaration
    public static Interval[] RangeIntersectAgg(this DbFunctions _, IEnumerable<Interval[]> input)
    Parameters
    Type Name Description
    DbFunctions _

    The instance.

    IEnumerable<><Interval[]> input

    The intervals on which to perform the intersection operation.

    Returns
    Type Description
    Interval[]
    See Also
    PostgreSQL documentation for aggregate functions.
    | Improve this Doc View Source

    RangeIntersectAgg(DbFunctions, IEnumerable<Interval>)

    Computes the intersection of the non-null input intervals. Corresponds to the PostgreSQL range_intersect_agg aggregate function.

    Declaration
    public static Interval RangeIntersectAgg(this DbFunctions _, IEnumerable<Interval> input)
    Parameters
    Type Name Description
    DbFunctions _

    The instance.

    IEnumerable<><Interval> input

    The intervals on which to perform the intersection operation.

    Returns
    Type Description
    Interval
    See Also
    PostgreSQL documentation for aggregate functions.
    | Improve this Doc View Source

    Sum(DbFunctions, IEnumerable<Duration>)

    Computes the sum of the non-null input intervals. Corresponds to the PostgreSQL sum aggregate function.

    Declaration
    public static Duration? Sum(this DbFunctions _, IEnumerable<Duration> input)
    Parameters
    Type Name Description
    DbFunctions _

    The instance.

    IEnumerable<><Duration> input

    The input values to be summed.

    Returns
    Type Description
    Duration?
    See Also
    PostgreSQL documentation for aggregate functions.
    | Improve this Doc View Source

    Sum(DbFunctions, IEnumerable<Period>)

    Computes the sum of the non-null input intervals. Corresponds to the PostgreSQL sum aggregate function.

    Declaration
    public static Period? Sum(this DbFunctions _, IEnumerable<Period> input)
    Parameters
    Type Name Description
    DbFunctions _

    The instance.

    IEnumerable<><Period> input

    The input values to be summed.

    Returns
    Type Description
    Period?
    See Also
    PostgreSQL documentation for aggregate functions.
    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright 2023 The Npgsql Development Team