Search Results for

    Show / Hide Table of Contents

    Class MySQLDbFunctionsExtensions

    Provides CLR methods that are translated to database functions when used in a LINQ to Entities queries. The methods in this class are accessed with Microsoft.EntityFrameworkCore.EF.Functions.

    Inheritance
    System.Object
    MySQLDbFunctionsExtensions
    Namespace: MySql.EntityFrameworkCore.Extensions
    Assembly: MySql.EntityFrameworkCore.dll
    Version: 9.3.0
    Syntax
    public static class MySQLDbFunctionsExtensions

    Methods

    DateDiffDay(DbFunctions, DateOnly, DateOnly)

    Counts the number of day boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(DAY,startDate,endDate).

    Declaration
    public static int DateDiffDay(this DbFunctions _, DateOnly startDate, DateOnly endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateOnly startDate

    Starting date for the calculation.

    System.DateOnly endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of day boundaries crossed between the dates.

    DateDiffDay(DbFunctions, DateTime, DateTime)

    Counts the number of day boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(DAY,startDate,endDate).

    Declaration
    public static int DateDiffDay(this DbFunctions _, DateTime startDate, DateTime endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTime startDate

    Starting date for the calculation.

    System.DateTime endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of day boundaries crossed between the dates.

    DateDiffDay(DbFunctions, DateTimeOffset, DateTimeOffset)

    Counts the number of day boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(DAY,startDate,endDate).

    Declaration
    public static int DateDiffDay(this DbFunctions _, DateTimeOffset startDate, DateTimeOffset endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTimeOffset startDate

    Starting date for the calculation.

    System.DateTimeOffset endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of day boundaries crossed between the dates.

    DateDiffDay(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>)

    Counts the number of day boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(DAY,startDate,endDate).

    Declaration
    public static int? DateDiffDay(this DbFunctions _, DateOnly? startDate, DateOnly? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateOnly> startDate

    Starting date for the calculation.

    System.Nullable<System.DateOnly> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of day boundaries crossed between the dates.

    DateDiffDay(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)

    Counts the number of day boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(DAY,startDate,endDate).

    Declaration
    public static int? DateDiffDay(this DbFunctions _, DateTime? startDate, DateTime? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTime> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTime> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of day boundaries crossed between the dates.

    DateDiffDay(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

    Counts the number of day boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(DAY,startDate,endDate).

    Declaration
    public static int? DateDiffDay(this DbFunctions _, DateTimeOffset? startDate, DateTimeOffset? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTimeOffset> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTimeOffset> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of day boundaries crossed between the dates.

    DateDiffHour(DbFunctions, DateTime, DateTime)

    Counts the number of hour boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(HOUR,startDate,endDate).

    Declaration
    public static int DateDiffHour(this DbFunctions _, DateTime startDate, DateTime endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTime startDate

    Starting date for the calculation.

    System.DateTime endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of hour boundaries crossed between the dates.

    DateDiffHour(DbFunctions, DateTimeOffset, DateTimeOffset)

    Counts the number of hour boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(HOUR,startDate,endDate).

    Declaration
    public static int DateDiffHour(this DbFunctions _, DateTimeOffset startDate, DateTimeOffset endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTimeOffset startDate

    Starting date for the calculation.

    System.DateTimeOffset endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of hour boundaries crossed between the dates.

    DateDiffHour(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)

    Counts the number of hour boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(HOUR,startDate,endDate).

    Declaration
    public static int? DateDiffHour(this DbFunctions _, DateTime? startDate, DateTime? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTime> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTime> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of hour boundaries crossed between the dates.

    DateDiffHour(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

    Counts the number of hour boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(HOUR,startDate,endDate).

    Declaration
    public static int? DateDiffHour(this DbFunctions _, DateTimeOffset? startDate, DateTimeOffset? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTimeOffset> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTimeOffset> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of hour boundaries crossed between the dates.

    DateDiffMicrosecond(DbFunctions, DateTime, DateTime)

    Counts the number of microsecond boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MICROSECOND,startDate,endDate).

    Declaration
    public static int DateDiffMicrosecond(this DbFunctions _, DateTime startDate, DateTime endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTime startDate

    Starting date for the calculation.

    System.DateTime endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of microsecond boundaries crossed between the dates.

    DateDiffMicrosecond(DbFunctions, DateTimeOffset, DateTimeOffset)

    Counts the number of microsecond boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MICROSECOND,startDate,endDate).

    Declaration
    public static int DateDiffMicrosecond(this DbFunctions _, DateTimeOffset startDate, DateTimeOffset endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTimeOffset startDate

    Starting date for the calculation.

    System.DateTimeOffset endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of microsecond boundaries crossed between the dates.

    DateDiffMicrosecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)

    Counts the number of microsecond boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MICROSECOND,startDate,endDate).

    Declaration
    public static int? DateDiffMicrosecond(this DbFunctions _, DateTime? startDate, DateTime? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTime> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTime> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of microsecond boundaries crossed between the dates.

    DateDiffMicrosecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

    Counts the number of microsecond boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MICROSECOND,startDate,endDate).

    Declaration
    public static int? DateDiffMicrosecond(this DbFunctions _, DateTimeOffset? startDate, DateTimeOffset? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTimeOffset> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTimeOffset> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of microsecond boundaries crossed between the dates.

    DateDiffMinute(DbFunctions, DateTime, DateTime)

    Counts the number of minute boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MINUTE,startDate,endDate).

    Declaration
    public static int DateDiffMinute(this DbFunctions _, DateTime startDate, DateTime endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTime startDate

    Starting date for the calculation.

    System.DateTime endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of minute boundaries crossed between the dates.

    DateDiffMinute(DbFunctions, DateTimeOffset, DateTimeOffset)

    Counts the number of minute boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MINUTE,startDate,endDate).

    Declaration
    public static int DateDiffMinute(this DbFunctions _, DateTimeOffset startDate, DateTimeOffset endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTimeOffset startDate

    Starting date for the calculation.

    System.DateTimeOffset endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of minute boundaries crossed between the dates.

    DateDiffMinute(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)

    Counts the number of minute boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MINUTE,startDate,endDate).

    Declaration
    public static int? DateDiffMinute(this DbFunctions _, DateTime? startDate, DateTime? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTime> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTime> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of minute boundaries crossed between the dates.

    DateDiffMinute(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

    Counts the number of minute boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MINUTE,startDate,endDate).

    Declaration
    public static int? DateDiffMinute(this DbFunctions _, DateTimeOffset? startDate, DateTimeOffset? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTimeOffset> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTimeOffset> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of minute boundaries crossed between the dates.

    DateDiffMonth(DbFunctions, DateOnly, DateOnly)

    Counts the number of month boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MONTH,startDate,endDate).

    Declaration
    public static int DateDiffMonth(this DbFunctions _, DateOnly startDate, DateOnly endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateOnly startDate

    Starting date for the calculation.

    System.DateOnly endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of month boundaries crossed between the dates.

    DateDiffMonth(DbFunctions, DateTime, DateTime)

    Counts the number of month boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MONTH,startDate,endDate).

    Declaration
    public static int DateDiffMonth(this DbFunctions _, DateTime startDate, DateTime endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTime startDate

    Starting date for the calculation.

    System.DateTime endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of month boundaries crossed between the dates.

    DateDiffMonth(DbFunctions, DateTimeOffset, DateTimeOffset)

    Counts the number of month boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MONTH,startDate,endDate).

    Declaration
    public static int DateDiffMonth(this DbFunctions _, DateTimeOffset startDate, DateTimeOffset endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTimeOffset startDate

    Starting date for the calculation.

    System.DateTimeOffset endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of month boundaries crossed between the dates.

    DateDiffMonth(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>)

    Counts the number of month boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MONTH,startDate,endDate).

    Declaration
    public static int? DateDiffMonth(this DbFunctions _, DateOnly? startDate, DateOnly? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateOnly> startDate

    Starting date for the calculation.

    System.Nullable<System.DateOnly> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of month boundaries crossed between the dates.

    DateDiffMonth(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)

    Counts the number of month boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MONTH,startDate,endDate).

    Declaration
    public static int? DateDiffMonth(this DbFunctions _, DateTime? startDate, DateTime? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTime> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTime> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of month boundaries crossed between the dates.

    DateDiffMonth(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

    Counts the number of month boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(MONTH,startDate,endDate).

    Declaration
    public static int? DateDiffMonth(this DbFunctions _, DateTimeOffset? startDate, DateTimeOffset? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTimeOffset> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTimeOffset> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of month boundaries crossed between the dates.

    DateDiffSecond(DbFunctions, DateTime, DateTime)

    Counts the number of boundaries (in seconds) crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(SECOND,startDate,endDate).

    Declaration
    public static int DateDiffSecond(this DbFunctions _, DateTime startDate, DateTime endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTime startDate

    Starting date for the calculation.

    System.DateTime endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of boundaries (in seconds) crossed between the dates.

    DateDiffSecond(DbFunctions, DateTimeOffset, DateTimeOffset)

    Counts the number of boundaries (in seconds) crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(SECOND,startDate,endDate).

    Declaration
    public static int DateDiffSecond(this DbFunctions _, DateTimeOffset startDate, DateTimeOffset endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTimeOffset startDate

    Starting date for the calculation.

    System.DateTimeOffset endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of boundaries (in seconds) crossed between the dates.

    DateDiffSecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)

    Counts the number of boundaries (in seconds) crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(SECOND,startDate,endDate).

    Declaration
    public static int? DateDiffSecond(this DbFunctions _, DateTime? startDate, DateTime? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTime> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTime> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of boundaries (in seconds) crossed between the dates.

    DateDiffSecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

    Counts the number of boundaries (in seconds) crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(SECOND,startDate,endDate).

    Declaration
    public static int? DateDiffSecond(this DbFunctions _, DateTimeOffset? startDate, DateTimeOffset? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTimeOffset> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTimeOffset> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of boundaries (in seconds) crossed between the dates.

    DateDiffYear(DbFunctions, DateOnly, DateOnly)

    Counts the number of year boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(YEAR,startDate,endDate).

    Declaration
    public static int DateDiffYear(this DbFunctions _, DateOnly startDate, DateOnly endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateOnly startDate

    Starting date for the calculation.

    System.DateOnly endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of year boundaries crossed between the dates.

    DateDiffYear(DbFunctions, DateTime, DateTime)

    Counts the number of year boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(YEAR,startDate,endDate).

    Declaration
    public static int DateDiffYear(this DbFunctions _, DateTime startDate, DateTime endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTime startDate

    Starting date for the calculation.

    System.DateTime endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of year boundaries crossed between the dates.

    DateDiffYear(DbFunctions, DateTimeOffset, DateTimeOffset)

    Counts the number of year boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(YEAR,startDate,endDate).

    Declaration
    public static int DateDiffYear(this DbFunctions _, DateTimeOffset startDate, DateTimeOffset endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.DateTimeOffset startDate

    Starting date for the calculation.

    System.DateTimeOffset endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Int32

    Number of year boundaries crossed between the dates.

    DateDiffYear(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>)

    Counts the number of year boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(YEAR,startDate,endDate).

    Declaration
    public static int? DateDiffYear(this DbFunctions _, DateOnly? startDate, DateOnly? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateOnly> startDate

    Starting date for the calculation.

    System.Nullable<System.DateOnly> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of year boundaries crossed between the dates.

    DateDiffYear(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)

    Counts the number of year boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(YEAR,startDate,endDate).

    Declaration
    public static int? DateDiffYear(this DbFunctions _, DateTime? startDate, DateTime? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTime> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTime> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of year boundaries crossed between the dates.

    DateDiffYear(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

    Counts the number of year boundaries crossed between the startDate and endDate. Corresponds to TIMESTAMPDIFF(YEAR,startDate,endDate).

    Declaration
    public static int? DateDiffYear(this DbFunctions _, DateTimeOffset? startDate, DateTimeOffset? endDate)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.Nullable<System.DateTimeOffset> startDate

    Starting date for the calculation.

    System.Nullable<System.DateTimeOffset> endDate

    Ending date for the calculation.

    Returns
    Type Description
    System.Nullable<System.Int32>

    Number of year boundaries crossed between the dates.

    Like<T>(DbFunctions, T, String)

    An implementation of the SQL LIKE operation. In relational databases this is usually directly translated to SQL.

    Note that if this function is translated into SQL, then the semantics of the comparison depends on the database configuration. In particular, it may be either case-sensitive or case-insensitive. If this function is evaluated on the client, then it always uses a case-insensitive comparison.

    Declaration
    public static bool Like<T>(this DbFunctions _, T matchExpression, string pattern)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    T matchExpression

    The property of entity that is to be matched.

    System.String pattern

    A pattern that may involve wildcards %,_,[,],^.

    Returns
    Type Description
    System.Boolean

    true if there is a match; otherwise, false.

    Type Parameters
    Name Description
    T

    Like<T>(DbFunctions, T, String, String)

    An implementation of the SQL LIKE operation. In relational databases, this is usually directly translated to SQL.

    Note that if this function is translated into SQL, then the semantics of the comparison depends on the database configuration. In particular, it may be either case-sensitive or case-insensitive. If this function is evaluated on the client, then it always uses a case-insensitive comparison.

    Declaration
    public static bool Like<T>(this DbFunctions _, T matchExpression, string pattern, string escapeCharacter)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    T matchExpression

    The property of entity that is to be matched.

    System.String pattern

    A pattern that may involve wildcards %,_,[,],^.

    System.String escapeCharacter

    The escape character (as a single character string) to use in front of %,_,[,],^ if they are not used as wildcards.

    Returns
    Type Description
    System.Boolean

    true if there is a match; otherwise, false.

    Type Parameters
    Name Description
    T

    Match(DbFunctions, String[], String, MySQLMatchSearchMode)

    An implementation of the SQL MATCH function used to perform a natural language search for a string against a text collection. A collection is a set of one or more columns included in a FULLTEXT index.

    MATCH (col1,col2,...) AGAINST (expr [search_modifier])

    Declaration
    public static bool Match(this DbFunctions _, string[] properties, string pattern, MySQLMatchSearchMode searchMode)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbFunctions _

    The DbFunctions instance.

    System.String[] properties

    The columns of the entity that is to be matched.

    System.String pattern

    A pattern that may involve wildcards %,_,[,],^.

    MySQLMatchSearchMode searchMode

    Indicates what type of search to perform

    Returns
    Type Description
    System.Boolean

    true if there is a match; otherwise, false.

    In This Article
    • Methods
      • DateDiffDay(DbFunctions, DateOnly, DateOnly)
      • DateDiffDay(DbFunctions, DateTime, DateTime)
      • DateDiffDay(DbFunctions, DateTimeOffset, DateTimeOffset)
      • DateDiffDay(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>)
      • DateDiffDay(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)
      • DateDiffDay(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)
      • DateDiffHour(DbFunctions, DateTime, DateTime)
      • DateDiffHour(DbFunctions, DateTimeOffset, DateTimeOffset)
      • DateDiffHour(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)
      • DateDiffHour(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)
      • DateDiffMicrosecond(DbFunctions, DateTime, DateTime)
      • DateDiffMicrosecond(DbFunctions, DateTimeOffset, DateTimeOffset)
      • DateDiffMicrosecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)
      • DateDiffMicrosecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)
      • DateDiffMinute(DbFunctions, DateTime, DateTime)
      • DateDiffMinute(DbFunctions, DateTimeOffset, DateTimeOffset)
      • DateDiffMinute(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)
      • DateDiffMinute(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)
      • DateDiffMonth(DbFunctions, DateOnly, DateOnly)
      • DateDiffMonth(DbFunctions, DateTime, DateTime)
      • DateDiffMonth(DbFunctions, DateTimeOffset, DateTimeOffset)
      • DateDiffMonth(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>)
      • DateDiffMonth(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)
      • DateDiffMonth(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)
      • DateDiffSecond(DbFunctions, DateTime, DateTime)
      • DateDiffSecond(DbFunctions, DateTimeOffset, DateTimeOffset)
      • DateDiffSecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)
      • DateDiffSecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)
      • DateDiffYear(DbFunctions, DateOnly, DateOnly)
      • DateDiffYear(DbFunctions, DateTime, DateTime)
      • DateDiffYear(DbFunctions, DateTimeOffset, DateTimeOffset)
      • DateDiffYear(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>)
      • DateDiffYear(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)
      • DateDiffYear(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)
      • Like<T>(DbFunctions, T, String)
      • Like<T>(DbFunctions, T, String, String)
      • Match(DbFunctions, String[], String, MySQLMatchSearchMode)
    Back to top Copyright © 2021, 2025, Oracle and/or its affiliates.