DbFunctions DbFunctions DbFunctions Class

Definition

Provides CLR methods that get translated to database functions when used in LINQ to Entities queries. The methods on this class are accessed via Functions.

public class DbFunctions
type DbFunctions = class
Public Class DbFunctions
Inheritance
DbFunctionsDbFunctionsDbFunctions

Methods

Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

ToString() ToString() ToString()

Returns a string that represents the current object.

Extension Methods

Like(DbFunctions, String, String) Like(DbFunctions, String, String) Like(DbFunctions, String, String)

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

Note that if this function is translated into SQL, then the semantics of the comparison will depend 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 will always use a case-insensitive comparison.

Like(DbFunctions, String, String, String) Like(DbFunctions, String, String, String) Like(DbFunctions, String, String, String)

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

Note that if this function is translated into SQL, then the semantics of the comparison will depend 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 will always use a case-insensitive comparison.

DateDiffDay(DbFunctions, DateTime, DateTime) DateDiffDay(DbFunctions, DateTime, DateTime) DateDiffDay(DbFunctions, DateTime, DateTime)

Counts the number of day boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(DAY,startDate,endDate).

DateDiffDay(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffDay(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffDay(DbFunctions, DateTimeOffset, DateTimeOffset)

Counts the number of day boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(DAY,startDate,endDate).

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

Counts the number of day boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(DAY,startDate,endDate).

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

Counts the number of day boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(DAY,startDate,endDate).

DateDiffHour(DbFunctions, DateTime, DateTime) DateDiffHour(DbFunctions, DateTime, DateTime) DateDiffHour(DbFunctions, DateTime, DateTime)

Counts the number of hour boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(HOUR,startDate,endDate).

DateDiffHour(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffHour(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffHour(DbFunctions, DateTimeOffset, DateTimeOffset)

Counts the number of hour boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(HOUR,startDate,endDate).

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

Counts the number of hour boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(HOUR,startDate,endDate).

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

Counts the number of hour boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(HOUR,startDate,endDate).

DateDiffMicrosecond(DbFunctions, DateTime, DateTime) DateDiffMicrosecond(DbFunctions, DateTime, DateTime) DateDiffMicrosecond(DbFunctions, DateTime, DateTime)

Counts the number of microsecond boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MICROSECOND,startDate,endDate).

DateDiffMicrosecond(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffMicrosecond(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffMicrosecond(DbFunctions, DateTimeOffset, DateTimeOffset)

Counts the number of microsecond boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MICROSECOND,startDate,endDate).

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

Counts the number of microsecond boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MICROSECOND,startDate,endDate).

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

Counts the number of microsecond boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MICROSECOND,startDate,endDate).

DateDiffMillisecond(DbFunctions, DateTime, DateTime) DateDiffMillisecond(DbFunctions, DateTime, DateTime) DateDiffMillisecond(DbFunctions, DateTime, DateTime)

Counts the number of millisecond boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MILLISECOND,startDate,endDate).

DateDiffMillisecond(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffMillisecond(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffMillisecond(DbFunctions, DateTimeOffset, DateTimeOffset)

Counts the number of millisecond boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MILLISECOND,startDate,endDate).

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

Counts the number of millisecond boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MILLISECOND,startDate,endDate).

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

Counts the number of millisecond boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MILLISECOND,startDate,endDate).

DateDiffMinute(DbFunctions, DateTime, DateTime) DateDiffMinute(DbFunctions, DateTime, DateTime) DateDiffMinute(DbFunctions, DateTime, DateTime)

Counts the number of minute boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MINUTE,startDate,endDate).

DateDiffMinute(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffMinute(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffMinute(DbFunctions, DateTimeOffset, DateTimeOffset)

Counts the number of minute boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MINUTE,startDate,endDate).

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

Counts the number of minute boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MINUTE,startDate,endDate).

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

Counts the number of minute boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MINUTE,startDate,endDate).

DateDiffMonth(DbFunctions, DateTime, DateTime) DateDiffMonth(DbFunctions, DateTime, DateTime) DateDiffMonth(DbFunctions, DateTime, DateTime)

Counts the number of month boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MONTH,startDate,endDate).

DateDiffMonth(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffMonth(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffMonth(DbFunctions, DateTimeOffset, DateTimeOffset)

Counts the number of month boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MONTH,startDate,endDate).

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

Counts the number of month boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MONTH,startDate,endDate).

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

Counts the number of month boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(MONTH,startDate,endDate).

DateDiffNanosecond(DbFunctions, DateTime, DateTime) DateDiffNanosecond(DbFunctions, DateTime, DateTime) DateDiffNanosecond(DbFunctions, DateTime, DateTime)

Counts the number of nanosecond boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(NANOSECOND,startDate,endDate).

DateDiffNanosecond(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffNanosecond(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffNanosecond(DbFunctions, DateTimeOffset, DateTimeOffset)

Counts the number of nanosecond boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(NANOSECOND,startDate,endDate).

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

Counts the number of nanosecond boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(NANOSECOND,startDate,endDate).

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

Counts the number of nanosecond boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(NANOSECOND,startDate,endDate).

DateDiffSecond(DbFunctions, DateTime, DateTime) DateDiffSecond(DbFunctions, DateTime, DateTime) DateDiffSecond(DbFunctions, DateTime, DateTime)

Counts the number of second boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(SECOND,startDate,endDate).

DateDiffSecond(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffSecond(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffSecond(DbFunctions, DateTimeOffset, DateTimeOffset)

Counts the number of second boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(SECOND,startDate,endDate).

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

Counts the number of second boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(SECOND,startDate,endDate).

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

Counts the number of second boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(SECOND,startDate,endDate).

DateDiffYear(DbFunctions, DateTime, DateTime) DateDiffYear(DbFunctions, DateTime, DateTime) DateDiffYear(DbFunctions, DateTime, DateTime)

Counts the number of year boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(YEAR,startDate,endDate).

DateDiffYear(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffYear(DbFunctions, DateTimeOffset, DateTimeOffset) DateDiffYear(DbFunctions, DateTimeOffset, DateTimeOffset)

Counts the number of year boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(YEAR,startDate,endDate).

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

Counts the number of year boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(YEAR,startDate,endDate).

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

Counts the number of year boundaries crossed between the startDate and endDate. Corresponds to SQL Server's DATEDIFF(YEAR,startDate,endDate).

FreeText(DbFunctions, String, String) FreeText(DbFunctions, String, String) FreeText(DbFunctions, String, String)

A DbFunction method stub that can be used in LINQ queries to target the SQL Server FREETEXT store function.

FreeText(DbFunctions, String, String, Int32) FreeText(DbFunctions, String, String, Int32) FreeText(DbFunctions, String, String, Int32)

A DbFunction method stub that can be used in LINQ queries to target the SQL Server FREETEXT store function.

Applies to