DbFunctions Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
public sealed class DbFunctions
type DbFunctions = class
Public Class DbFunctions
Public NotInheritable Class DbFunctions
- Inheritance
-
DbFunctions
Remarks
See Database functions for more information and examples.
Extension Methods
CoalesceUndefined<T>(DbFunctions, T, T) |
Coalesces a Cosmos |
IsDefined(DbFunctions, Object) |
Returns a boolean indicating if the property has been assigned a value. Corresponds to the Cosmos |
VectorDistance(DbFunctions, ReadOnlyMemory<Byte>, ReadOnlyMemory<Byte>, Boolean, DistanceFunction) |
Returns the distance between two vectors, given a distance function (aka similarity measure). |
VectorDistance(DbFunctions, ReadOnlyMemory<Byte>, ReadOnlyMemory<Byte>, Boolean) |
Returns the distance between two vectors, given a distance function (aka similarity measure). |
VectorDistance(DbFunctions, ReadOnlyMemory<Byte>, ReadOnlyMemory<Byte>) |
Returns the distance between two vectors, using the distance function and data type defined using IsVector(PropertyBuilder, DistanceFunction, Int32) . |
VectorDistance(DbFunctions, ReadOnlyMemory<SByte>, ReadOnlyMemory<SByte>, Boolean, DistanceFunction) |
Returns the distance between two vectors, given a distance function (aka similarity measure). |
VectorDistance(DbFunctions, ReadOnlyMemory<SByte>, ReadOnlyMemory<SByte>, Boolean) |
Returns the distance between two vectors, given a distance function (aka similarity measure). |
VectorDistance(DbFunctions, ReadOnlyMemory<SByte>, ReadOnlyMemory<SByte>) |
Returns the distance between two vectors, using the distance function and data type defined using IsVector(PropertyBuilder, DistanceFunction, Int32) . |
VectorDistance(DbFunctions, ReadOnlyMemory<Single>, ReadOnlyMemory<Single>, Boolean, DistanceFunction) |
Returns the distance between two vectors, given a distance function (aka similarity measure). |
VectorDistance(DbFunctions, ReadOnlyMemory<Single>, ReadOnlyMemory<Single>, Boolean) |
Returns the distance between two vectors, given a distance function (aka similarity measure). |
VectorDistance(DbFunctions, ReadOnlyMemory<Single>, ReadOnlyMemory<Single>) |
Returns the distance between two vectors, using the distance function and data type defined using IsVector(PropertyBuilder, DistanceFunction, Int32) . |
Like(DbFunctions, String, String, String) |
An implementation of the SQL LIKE operation. On relational databases this is usually directly translated to SQL. |
Like(DbFunctions, String, String) |
An implementation of the SQL |
Random(DbFunctions) |
A random double number generator which generates a number between 0 and 1, exclusive. |
Collate<TProperty>(DbFunctions, TProperty, String) |
Explicitly specifies a collation to be used in a LINQ query. Can be used to generate fragments such as
|
Greatest<T>(DbFunctions, T[]) |
Returns the greatest value from the given list of values. Usually corresponds to the |
Least<T>(DbFunctions, T[]) |
Returns the smallest value from the given list of values. Usually corresponds to the |
Glob(DbFunctions, String, String) |
Maps to the SQLite |
Hex(DbFunctions, Byte[]) |
Maps to the SQLite |
Substr(DbFunctions, Byte[], Int32, Int32) |
Maps to the SQLite substr function which returns a subarray of the specified value. The subarray starts
at |
Substr(DbFunctions, Byte[], Int32) |
Maps to the SQLite |
Unhex(DbFunctions, String, String) |
Maps to the SQLite |
Unhex(DbFunctions, String) |
Maps to the SQLite |
AtTimeZone(DbFunctions, DateTime, String) |
Converts |
AtTimeZone(DbFunctions, DateTimeOffset, String) |
Converts |
Contains(DbFunctions, Object, String, Int32) |
A DbFunction method stub that can be used in LINQ queries to target the SQL Server |
Contains(DbFunctions, Object, String) |
A DbFunction method stub that can be used in LINQ queries to target the SQL Server |
Contains(DbFunctions, String, String, Int32) |
A DbFunction method stub that can be used in LINQ queries to target the SQL Server CONTAINS store function. |
Contains(DbFunctions, String, String) |
A DbFunction method stub that can be used in LINQ queries to target the SQL Server CONTAINS store function. |
DataLength(DbFunctions, Byte[]) |
Returns the number of bytes used to represent any expression. |
DataLength(DbFunctions, Nullable<Boolean>) |
Returns the number of bytes used to represent any expression. |
DataLength(DbFunctions, Nullable<DateTime>) |
Returns the number of bytes used to represent any expression. |
DataLength(DbFunctions, Nullable<DateTimeOffset>) |
Returns the number of bytes used to represent any expression. |
DataLength(DbFunctions, Nullable<Decimal>) |
Returns the number of bytes used to represent any expression. |
DataLength(DbFunctions, Nullable<Double>) |
Returns the number of bytes used to represent any expression. |
DataLength(DbFunctions, Nullable<Guid>) |
Returns the number of bytes used to represent any expression. |
DataLength(DbFunctions, Nullable<TimeSpan>) |
Returns the number of bytes used to represent any expression. |
DataLength(DbFunctions, String) |
Returns the number of bytes used to represent any expression. |
DateDiffDay(DbFunctions, DateOnly, DateOnly) |
Counts the number of day boundaries crossed between the |
DateDiffDay(DbFunctions, DateTime, DateTime) |
Counts the number of day boundaries crossed between the |
DateDiffDay(DbFunctions, DateTimeOffset, DateTimeOffset) |
Counts the number of day boundaries crossed between the |
DateDiffDay(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
Counts the number of day boundaries crossed between the |
DateDiffDay(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
Counts the number of day boundaries crossed between the |
DateDiffDay(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
Counts the number of day boundaries crossed between the |
DateDiffHour(DbFunctions, DateOnly, DateOnly) |
Counts the number of hour boundaries crossed between the |
DateDiffHour(DbFunctions, DateTime, DateTime) |
Counts the number of hour boundaries crossed between the |
DateDiffHour(DbFunctions, DateTimeOffset, DateTimeOffset) |
Counts the number of hour boundaries crossed between the |
DateDiffHour(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
Counts the number of hour boundaries crossed between the |
DateDiffHour(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
Counts the number of hour boundaries crossed between the |
DateDiffHour(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
Counts the number of hour boundaries crossed between the |
DateDiffHour(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>) |
Counts the number of hour boundaries crossed between the |
DateDiffHour(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>) |
Counts the number of hour boundaries crossed between the |
DateDiffHour(DbFunctions, TimeOnly, TimeOnly) |
Counts the number of hour boundaries crossed between the |
DateDiffHour(DbFunctions, TimeSpan, TimeSpan) |
Counts the number of hour boundaries crossed between the |
DateDiffMicrosecond(DbFunctions, DateOnly, DateOnly) |
Counts the number of microsecond boundaries crossed between the |
DateDiffMicrosecond(DbFunctions, DateTime, DateTime) |
Counts the number of microsecond boundaries crossed between the |
DateDiffMicrosecond(DbFunctions, DateTimeOffset, DateTimeOffset) |
Counts the number of microsecond boundaries crossed between the |
DateDiffMicrosecond(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
Counts the number of microsecond boundaries crossed between the |
DateDiffMicrosecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
Counts the number of microsecond boundaries crossed between the |
DateDiffMicrosecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
Counts the number of microsecond boundaries crossed between the |
DateDiffMicrosecond(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>) |
Counts the number of microsecond boundaries crossed between the |
DateDiffMicrosecond(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>) |
Counts the number of microsecond boundaries crossed between the |
DateDiffMicrosecond(DbFunctions, TimeOnly, TimeOnly) |
Counts the number of microsecond boundaries crossed between the |
DateDiffMicrosecond(DbFunctions, TimeSpan, TimeSpan) |
Counts the number of microsecond boundaries crossed between the |
DateDiffMillisecond(DbFunctions, DateOnly, DateOnly) |
Counts the number of millisecond boundaries crossed between the |
DateDiffMillisecond(DbFunctions, DateTime, DateTime) |
Counts the number of millisecond boundaries crossed between the |
DateDiffMillisecond(DbFunctions, DateTimeOffset, DateTimeOffset) |
Counts the number of millisecond boundaries crossed between the |
DateDiffMillisecond(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
Counts the number of millisecond boundaries crossed between the |
DateDiffMillisecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
Counts the number of millisecond boundaries crossed between the |
DateDiffMillisecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
Counts the number of millisecond boundaries crossed between the |
DateDiffMillisecond(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>) |
Counts the number of millisecond boundaries crossed between the |
DateDiffMillisecond(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>) |
Counts the number of millisecond boundaries crossed between the |
DateDiffMillisecond(DbFunctions, TimeOnly, TimeOnly) |
Counts the number of millisecond boundaries crossed between the |
DateDiffMillisecond(DbFunctions, TimeSpan, TimeSpan) |
Counts the number of millisecond boundaries crossed between the |
DateDiffMinute(DbFunctions, DateOnly, DateOnly) |
Counts the number of minute boundaries crossed between the |
DateDiffMinute(DbFunctions, DateTime, DateTime) |
Counts the number of minute boundaries crossed between the |
DateDiffMinute(DbFunctions, DateTimeOffset, DateTimeOffset) |
Counts the number of minute boundaries crossed between the |
DateDiffMinute(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
Counts the number of minute boundaries crossed between the |
DateDiffMinute(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
Counts the number of minute boundaries crossed between the |
DateDiffMinute(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
Counts the number of minute boundaries crossed between the |
DateDiffMinute(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>) |
Counts the number of minute boundaries crossed between the |
DateDiffMinute(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>) |
Counts the number of minute boundaries crossed between the |
DateDiffMinute(DbFunctions, TimeOnly, TimeOnly) |
Counts the number of minute boundaries crossed between the |
DateDiffMinute(DbFunctions, TimeSpan, TimeSpan) |
Counts the number of minute boundaries crossed between the |
DateDiffMonth(DbFunctions, DateOnly, DateOnly) |
Counts the number of month boundaries crossed between the |
DateDiffMonth(DbFunctions, DateTime, DateTime) |
Counts the number of month boundaries crossed between the |
DateDiffMonth(DbFunctions, DateTimeOffset, DateTimeOffset) |
Counts the number of month boundaries crossed between the |
DateDiffMonth(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
Counts the number of month boundaries crossed between the |
DateDiffMonth(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
Counts the number of month boundaries crossed between the |
DateDiffMonth(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
Counts the number of month boundaries crossed between the |
DateDiffNanosecond(DbFunctions, DateOnly, DateOnly) |
Counts the number of nanosecond boundaries crossed between the |
DateDiffNanosecond(DbFunctions, DateTime, DateTime) |
Counts the number of nanosecond boundaries crossed between the |
DateDiffNanosecond(DbFunctions, DateTimeOffset, DateTimeOffset) |
Counts the number of nanosecond boundaries crossed between the |
DateDiffNanosecond(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
Counts the number of nanosecond boundaries crossed between the |
DateDiffNanosecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
Counts the number of nanosecond boundaries crossed between the |
DateDiffNanosecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
Counts the number of nanosecond boundaries crossed between the |
DateDiffNanosecond(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>) |
Counts the number of nanosecond boundaries crossed between the |
DateDiffNanosecond(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>) |
Counts the number of nanosecond boundaries crossed between the |
DateDiffNanosecond(DbFunctions, TimeOnly, TimeOnly) |
Counts the number of nanosecond boundaries crossed between the |
DateDiffNanosecond(DbFunctions, TimeSpan, TimeSpan) |
Counts the number of nanosecond boundaries crossed between the |
DateDiffSecond(DbFunctions, DateOnly, DateOnly) |
Counts the number of second boundaries crossed between the |
DateDiffSecond(DbFunctions, DateTime, DateTime) |
Counts the number of second boundaries crossed between the |
DateDiffSecond(DbFunctions, DateTimeOffset, DateTimeOffset) |
Counts the number of second boundaries crossed between the |
DateDiffSecond(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
Counts the number of second boundaries crossed between the |
DateDiffSecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
Counts the number of second boundaries crossed between the |
DateDiffSecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
Counts the number of second boundaries crossed between the |
DateDiffSecond(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>) |
Counts the number of second boundaries crossed between the |
DateDiffSecond(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>) |
Counts the number of second boundaries crossed between the |
DateDiffSecond(DbFunctions, TimeOnly, TimeOnly) |
Counts the number of second boundaries crossed between the |
DateDiffSecond(DbFunctions, TimeSpan, TimeSpan) |
Counts the number of second boundaries crossed between the |
DateDiffWeek(DbFunctions, DateOnly, DateOnly) |
Counts the number of week boundaries crossed between the |
DateDiffWeek(DbFunctions, DateTime, DateTime) |
Counts the number of week boundaries crossed between the |
DateDiffWeek(DbFunctions, DateTimeOffset, DateTimeOffset) |
Counts the number of week boundaries crossed between the |
DateDiffWeek(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
Counts the number of week boundaries crossed between the |
DateDiffWeek(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
Counts the number of week boundaries crossed between the |
DateDiffWeek(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
Counts the number of week boundaries crossed between the |
DateDiffYear(DbFunctions, DateOnly, DateOnly) |
Counts the number of year boundaries crossed between the |
DateDiffYear(DbFunctions, DateTime, DateTime) |
Counts the number of year boundaries crossed between the |
DateDiffYear(DbFunctions, DateTimeOffset, DateTimeOffset) |
Counts the number of year boundaries crossed between the |
DateDiffYear(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
Counts the number of year boundaries crossed between the |
DateDiffYear(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
Counts the number of year boundaries crossed between |
DateDiffYear(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
Counts the number of year boundaries crossed between the |
DateFromParts(DbFunctions, Int32, Int32, Int32) |
Initializes a new instance of the DateTime structure to the specified year, month, day.
Corresponds to SQL Server's |
DateTime2FromParts(DbFunctions, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32) |
Initializes a new instance of the DateTime structure to the specified year, month, day, hour, minute, second,
fractions, and precision.
Corresponds to SQL Server's |
DateTimeFromParts(DbFunctions, Int32, Int32, Int32, Int32, Int32, Int32, Int32) |
Initializes a new instance of the DateTime structure to the specified year, month, day, hour, minute, second,
and millisecond.
Corresponds to SQL Server's |
DateTimeOffsetFromParts(DbFunctions, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32) |
Initializes a new instance of the DateTimeOffset structure to the specified year, month, day, hour, minute,
second, fractions, hourOffset, minuteOffset and precision.
Corresponds to SQL Server's
|
FreeText(DbFunctions, Object, String, Int32) |
A DbFunction method stub that can be used in LINQ queries to target the SQL Server |
FreeText(DbFunctions, Object, String) |
A DbFunction method stub that can be used in LINQ queries to target the SQL Server |
FreeText(DbFunctions, String, String, Int32) |
A DbFunction method stub that can be used in LINQ queries to target the SQL Server FREETEXT store function. |
FreeText(DbFunctions, String, String) |
A DbFunction method stub that can be used in LINQ queries to target the SQL Server FREETEXT store function. |
IsDate(DbFunctions, String) |
Validate if the given string is a valid date.
Corresponds to SQL Server's |
IsNumeric(DbFunctions, String) |
Validate if the given string is a valid numeric.
Corresponds to the SQL Server |
PatIndex(DbFunctions, String, String) |
Returns the starting position of the first occurrence of a pattern in a specified expression, or zero if the pattern is not found, on all valid text and character data types. |
SmallDateTimeFromParts(DbFunctions, Int32, Int32, Int32, Int32, Int32) |
Initializes a new instance of the DateTime structure to the specified year, month, day, hour and minute.
Corresponds to SQL Server's |
StandardDeviationPopulation(DbFunctions, IEnumerable<Byte>) |
Returns the population standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
StandardDeviationPopulation(DbFunctions, IEnumerable<Decimal>) |
Returns the population standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
StandardDeviationPopulation(DbFunctions, IEnumerable<Double>) |
Returns the population standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
StandardDeviationPopulation(DbFunctions, IEnumerable<Int16>) |
Returns the population standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
StandardDeviationPopulation(DbFunctions, IEnumerable<Int32>) |
Returns the population standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
StandardDeviationPopulation(DbFunctions, IEnumerable<Int64>) |
Returns the population standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
StandardDeviationPopulation(DbFunctions, IEnumerable<Single>) |
Returns the population standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
StandardDeviationSample(DbFunctions, IEnumerable<Byte>) |
Returns the sample standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
StandardDeviationSample(DbFunctions, IEnumerable<Decimal>) |
Returns the sample standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
StandardDeviationSample(DbFunctions, IEnumerable<Double>) |
Returns the sample standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
StandardDeviationSample(DbFunctions, IEnumerable<Int16>) |
Returns the sample standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
StandardDeviationSample(DbFunctions, IEnumerable<Int32>) |
Returns the sample standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
StandardDeviationSample(DbFunctions, IEnumerable<Int64>) |
Returns the sample standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
StandardDeviationSample(DbFunctions, IEnumerable<Single>) |
Returns the sample standard deviation of all values in the specified expression.
Corresponds to SQL Server's |
TimeFromParts(DbFunctions, Int32, Int32, Int32, Int32, Int32) |
Initializes a new instance of the TimeSpan structure to the specified hour, minute, second, fractions, and
precision. Corresponds to SQL Server's |
VariancePopulation(DbFunctions, IEnumerable<Byte>) |
Returns the population variance of all values in the specified expression.
Corresponds to SQL Server's |
VariancePopulation(DbFunctions, IEnumerable<Decimal>) |
Returns the population variance of all values in the specified expression.
Corresponds to SQL Server's |
VariancePopulation(DbFunctions, IEnumerable<Double>) |
Returns the population variance of all values in the specified expression.
Corresponds to SQL Server's |
VariancePopulation(DbFunctions, IEnumerable<Int16>) |
Returns the population variance of all values in the specified expression.
Corresponds to SQL Server's |
VariancePopulation(DbFunctions, IEnumerable<Int32>) |
Returns the population variance of all values in the specified expression.
Corresponds to SQL Server's |
VariancePopulation(DbFunctions, IEnumerable<Int64>) |
Returns the population variance of all values in the specified expression.
Corresponds to SQL Server's |
VariancePopulation(DbFunctions, IEnumerable<Single>) |
Returns the population variance of all values in the specified expression.
Corresponds to SQL Server's |
VarianceSample(DbFunctions, IEnumerable<Byte>) |
Returns the sample variance of all values in the specified expression.
Corresponds to SQL Server's |
VarianceSample(DbFunctions, IEnumerable<Decimal>) |
Returns the sample variance of all values in the specified expression.
Corresponds to SQL Server's |
VarianceSample(DbFunctions, IEnumerable<Double>) |
Returns the sample variance of all values in the specified expression.
Corresponds to SQL Server's |
VarianceSample(DbFunctions, IEnumerable<Int16>) |
Returns the sample variance of all values in the specified expression.
Corresponds to SQL Server's |
VarianceSample(DbFunctions, IEnumerable<Int32>) |
Returns the sample variance of all values in the specified expression.
Corresponds to SQL Server's |
VarianceSample(DbFunctions, IEnumerable<Int64>) |
Returns the sample variance of all values in the specified expression.
Corresponds to SQL Server's |
VarianceSample(DbFunctions, IEnumerable<Single>) |
Returns the sample variance of all values in the specified expression.
Corresponds to SQL Server's |