Export (0) Print
Expand All

DbFunctions Class

[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]

Provides common language runtime (CLR) methods that expose EDM canonical functions for use in DbContext or ObjectContext LINQ to Entities queries.

System.Object
  System.Data.Entity.DbFunctions

Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

public static class DbFunctions

The DbFunctions type exposes the following members.

  NameDescription
Public methodStatic memberAddDays(Nullable<DateTime>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddDays EDM function to add the given number of days to a date/time.
Public methodStatic memberAddDays(Nullable<DateTimeOffset>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddDays EDM function to add the given number of days to a date/time.
Public methodStatic memberAddHours(Nullable<DateTime>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddHours EDM function to add the given number of hours to a date/time.
Public methodStatic memberAddHours(Nullable<DateTimeOffset>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddHours EDM function to add the given number of hours to a date/time.
Public methodStatic memberAddHours(Nullable<TimeSpan>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddHours EDM function to add the given number of hours to a time span.
Public methodStatic memberAddMicroseconds(Nullable<DateTime>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddMicroseconds EDM function to add the given number of microseconds to a date/time.
Public methodStatic memberAddMicroseconds(Nullable<DateTimeOffset>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddMicroseconds EDM function to add the given number of microseconds to a date/time.
Public methodStatic memberAddMicroseconds(Nullable<TimeSpan>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddMicroseconds EDM function to add the given number of microseconds to a time span.
Public methodStatic memberAddMilliseconds(Nullable<DateTime>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddMilliseconds EDM function to add the given number of milliseconds to a date/time.
Public methodStatic memberAddMilliseconds(Nullable<DateTimeOffset>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddMilliseconds EDM function to add the given number of milliseconds to a date/time.
Public methodStatic memberAddMilliseconds(Nullable<TimeSpan>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddMilliseconds EDM function to add the given number of milliseconds to a time span.
Public methodStatic memberAddMinutes(Nullable<DateTime>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddMinutes EDM function to add the given number of minutes to a date/time.
Public methodStatic memberAddMinutes(Nullable<DateTimeOffset>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddMinutes EDM function to add the given number of minutes to a date/time.
Public methodStatic memberAddMinutes(Nullable<TimeSpan>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddMinutes EDM function to add the given number of minutes to a time span.
Public methodStatic memberAddMonths(Nullable<DateTime>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddMonths EDM function to add the given number of months to a date/time.
Public methodStatic memberAddMonths(Nullable<DateTimeOffset>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddMonths EDM function to add the given number of months to a date/time.
Public methodStatic memberAddNanoseconds(Nullable<DateTime>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddNanoseconds EDM function to add the given number of nanoseconds to a date/time.
Public methodStatic memberAddNanoseconds(Nullable<DateTimeOffset>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddNanoseconds EDM function to add the given number of nanoseconds to a date/time.
Public methodStatic memberAddNanoseconds(Nullable<TimeSpan>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddNanoseconds EDM function to add the given number of nanoseconds to a time span.
Public methodStatic memberAddSeconds(Nullable<DateTime>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddSeconds EDM function to add the given number of seconds to a date/time.
Public methodStatic memberAddSeconds(Nullable<DateTimeOffset>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddSeconds EDM function to add the given number of seconds to a date/time.
Public methodStatic memberAddSeconds(Nullable<TimeSpan>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddSeconds EDM function to add the given number of seconds to a time span.
Public methodStatic memberAddYears(Nullable<DateTime>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddYears EDM function to add the given number of years to a date/time.
Public methodStatic memberAddYears(Nullable<DateTimeOffset>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical AddYears EDM function to add the given number of years to a date/time.
Public methodStatic memberAsNonUnicodeWhen used as part of a LINQ to Entities query, this method acts as an operator that ensures the input is treated as a non-Unicode string.
Public methodStatic memberAsUnicodeWhen used as part of a LINQ to Entities query, this method acts as an operator that ensures the input is treated as a Unicode string.
Public methodStatic memberCreateDateTimeWhen used as part of a LINQ to Entities query, this method invokes the canonical CreateDateTime EDM function to create a new DateTime object.
Public methodStatic memberCreateDateTimeOffsetWhen used as part of a LINQ to Entities query, this method invokes the canonical CreateDateTimeOffset EDM function to create a new DateTimeOffset object.
Public methodStatic memberCreateTimeWhen used as part of a LINQ to Entities query, this method invokes the canonical CreateTime EDM function to create a new TimeSpan object.
Public methodStatic memberDiffDays(Nullable<DateTime>, Nullable<DateTime>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffDays EDM function to calculate the number of days between two date/times.
Public methodStatic memberDiffDays(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffDays EDM function to calculate the number of days between two date/times.
Public methodStatic memberDiffHours(Nullable<DateTime>, Nullable<DateTime>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffHours EDM function to calculate the number of hours between two date/times.
Public methodStatic memberDiffHours(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffHours EDM function to calculate the number of hours between two date/times.
Public methodStatic memberDiffHours(Nullable<TimeSpan>, Nullable<TimeSpan>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffHours EDM function to calculate the number of hours between two time spans.
Public methodStatic memberDiffMicroseconds(Nullable<DateTime>, Nullable<DateTime>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffMicroseconds EDM function to calculate the number of microseconds between two date/times.
Public methodStatic memberDiffMicroseconds(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffMicroseconds EDM function to calculate the number of microseconds between two date/times.
Public methodStatic memberDiffMicroseconds(Nullable<TimeSpan>, Nullable<TimeSpan>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffMicroseconds EDM function to calculate the number of microseconds between two time spans.
Public methodStatic memberDiffMilliseconds(Nullable<DateTime>, Nullable<DateTime>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffMilliseconds EDM function to calculate the number of milliseconds between two date/times.
Public methodStatic memberDiffMilliseconds(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffMilliseconds EDM function to calculate the number of milliseconds between two date/times.
Public methodStatic memberDiffMilliseconds(Nullable<TimeSpan>, Nullable<TimeSpan>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffMilliseconds EDM function to calculate the number of milliseconds between two time spans.
Public methodStatic memberDiffMinutes(Nullable<DateTime>, Nullable<DateTime>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffMinutes EDM function to calculate the number of minutes between two date/times.
Public methodStatic memberDiffMinutes(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffMinutes EDM function to calculate the number of minutes between two date/times.
Public methodStatic memberDiffMinutes(Nullable<TimeSpan>, Nullable<TimeSpan>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffMinutes EDM function to calculate the number of minutes between two time spans.
Public methodStatic memberDiffMonths(Nullable<DateTime>, Nullable<DateTime>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffMonths EDM function to calculate the number of months between two date/times.
Public methodStatic memberDiffMonths(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffMonths EDM function to calculate the number of months between two date/times.
Public methodStatic memberDiffNanoseconds(Nullable<DateTime>, Nullable<DateTime>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffNanoseconds EDM function to calculate the number of nanoseconds between two date/times.
Public methodStatic memberDiffNanoseconds(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffNanoseconds EDM function to calculate the number of nanoseconds between two date/times.
Public methodStatic memberDiffNanoseconds(Nullable<TimeSpan>, Nullable<TimeSpan>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffNanoseconds EDM function to calculate the number of nanoseconds between two time spans.
Public methodStatic memberDiffSeconds(Nullable<DateTime>, Nullable<DateTime>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffSeconds EDM function to calculate the number of seconds between two date/times.
Public methodStatic memberDiffSeconds(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffSeconds EDM function to calculate the number of seconds between two date/times.
Public methodStatic memberDiffSeconds(Nullable<TimeSpan>, Nullable<TimeSpan>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffSeconds EDM function to calculate the number of seconds between two time spans.
Public methodStatic memberDiffYears(Nullable<DateTime>, Nullable<DateTime>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffYears EDM function to calculate the number of years between two date/times.
Public methodStatic memberDiffYears(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)When used as part of a LINQ to Entities query, this method invokes the canonical DiffYears EDM function to calculate the number of years between two date/times.
Public methodStatic memberGetTotalOffsetMinutesWhen used as part of a LINQ to Entities query, this method invokes the canonical GetTotalOffsetMinutes EDM function to return the number of minutes that the given date/time is offset from UTC. This is generally between +780 and -780 (+ or - 13 hrs).
Public methodStatic memberLeftWhen used as part of a LINQ to Entities query, this method invokes the canonical Left EDM function to return a given number of the leftmost characters in a string.
Public methodStatic memberReverseWhen used as part of a LINQ to Entities query, this method invokes the canonical Reverse EDM function to return a given string with the order of the characters reversed.
Public methodStatic memberRightWhen used as part of a LINQ to Entities query, this method invokes the canonical Right EDM function to return a given number of the rightmost characters in a string.
Public methodStatic memberStandardDeviation(IEnumerable<Decimal>)When used as part of a LINQ to Entities query, this method invokes the canonical StDev EDM function to calculate the standard deviation of the collection.
Public methodStatic memberStandardDeviation(IEnumerable<Double>)When used as part of a LINQ to Entities query, this method invokes the canonical StDev EDM function to calculate the standard deviation of the collection.
Public methodStatic memberStandardDeviation(IEnumerable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical StDev EDM function to calculate the standard deviation of the collection.
Public methodStatic memberStandardDeviation(IEnumerable<Int64>)When used as part of a LINQ to Entities query, this method invokes the canonical StDev EDM function to calculate the standard deviation of the collection.
Public methodStatic memberStandardDeviation(IEnumerable<Nullable<Decimal>>)When used as part of a LINQ to Entities query, this method invokes the canonical StDev EDM function to calculate the standard deviation of the collection.
Public methodStatic memberStandardDeviation(IEnumerable<Nullable<Double>>)When used as part of a LINQ to Entities query, this method invokes the canonical StDev EDM function to calculate the standard deviation of the collection.
Public methodStatic memberStandardDeviation(IEnumerable<Nullable<Int32>>)When used as part of a LINQ to Entities query, this method invokes the canonical StDev EDM function to calculate the standard deviation of the collection.
Public methodStatic memberStandardDeviation(IEnumerable<Nullable<Int64>>)When used as part of a LINQ to Entities query, this method invokes the canonical StDev EDM function to calculate the standard deviation of the collection.
Public methodStatic memberStandardDeviationP(IEnumerable<Decimal>)When used as part of a LINQ to Entities query, this method invokes the canonical StDevP EDM function to calculate the standard deviation for the population.
Public methodStatic memberStandardDeviationP(IEnumerable<Double>)When used as part of a LINQ to Entities query, this method invokes the canonical StDevP EDM function to calculate the standard deviation for the population.
Public methodStatic memberStandardDeviationP(IEnumerable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical StDevP EDM function to calculate the standard deviation for the population.
Public methodStatic memberStandardDeviationP(IEnumerable<Int64>)When used as part of a LINQ to Entities query, this method invokes the canonical StDevP EDM function to calculate the standard deviation for the population.
Public methodStatic memberStandardDeviationP(IEnumerable<Nullable<Decimal>>)When used as part of a LINQ to Entities query, this method invokes the canonical StDevP EDM function to calculate the standard deviation for the population.
Public methodStatic memberStandardDeviationP(IEnumerable<Nullable<Double>>)When used as part of a LINQ to Entities query, this method invokes the canonical StDevP EDM function to calculate the standard deviation for the population.
Public methodStatic memberStandardDeviationP(IEnumerable<Nullable<Int32>>)When used as part of a LINQ to Entities query, this method invokes the canonical StDevP EDM function to calculate the standard deviation for the population.
Public methodStatic memberStandardDeviationP(IEnumerable<Nullable<Int64>>)When used as part of a LINQ to Entities query, this method invokes the canonical StDevP EDM function to calculate the standard deviation for the population.
Public methodStatic memberTruncate(Nullable<Decimal>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical Truncate EDM function to truncate the given value to the number of specified digits.
Public methodStatic memberTruncate(Nullable<Double>, Nullable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical Truncate EDM function to truncate the given value to the number of specified digits.
Public methodStatic memberTruncateTime(Nullable<DateTime>)When used as part of a LINQ to Entities query, this method invokes the canonical TruncateTime EDM function to return the given date with the time portion cleared.
Public methodStatic memberTruncateTime(Nullable<DateTimeOffset>)When used as part of a LINQ to Entities query, this method invokes the canonical TruncateTime EDM function to return the given date with the time portion cleared.
Public methodStatic memberVar(IEnumerable<Decimal>)When used as part of a LINQ to Entities query, this method invokes the canonical Var EDM function to calculate the variance of the collection.
Public methodStatic memberVar(IEnumerable<Double>)When used as part of a LINQ to Entities query, this method invokes the canonical Var EDM function to calculate the variance of the collection.
Public methodStatic memberVar(IEnumerable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical Var EDM function to calculate the variance of the collection.
Public methodStatic memberVar(IEnumerable<Int64>)When used as part of a LINQ to Entities query, this method invokes the canonical Var EDM function to calculate the variance of the collection.
Public methodStatic memberVar(IEnumerable<Nullable<Decimal>>)When used as part of a LINQ to Entities query, this method invokes the canonical Var EDM function to calculate the variance of the collection.
Public methodStatic memberVar(IEnumerable<Nullable<Double>>)When used as part of a LINQ to Entities query, this method invokes the canonical Var EDM function to calculate the variance of the collection.
Public methodStatic memberVar(IEnumerable<Nullable<Int32>>)When used as part of a LINQ to Entities query, this method invokes the canonical Var EDM function to calculate the variance of the collection.
Public methodStatic memberVar(IEnumerable<Nullable<Int64>>)When used as part of a LINQ to Entities query, this method invokes the canonical Var EDM function to calculate the variance of the collection.
Public methodStatic memberVarP(IEnumerable<Decimal>)When used as part of a LINQ to Entities query, this method invokes the canonical VarP EDM function to calculate the variance for the population.
Public methodStatic memberVarP(IEnumerable<Double>)When used as part of a LINQ to Entities query, this method invokes the canonical VarP EDM function to calculate the variance for the population.
Public methodStatic memberVarP(IEnumerable<Int32>)When used as part of a LINQ to Entities query, this method invokes the canonical VarP EDM function to calculate the variance for the population.
Public methodStatic memberVarP(IEnumerable<Int64>)When used as part of a LINQ to Entities query, this method invokes the canonical VarP EDM function to calculate the variance for the population.
Public methodStatic memberVarP(IEnumerable<Nullable<Decimal>>)When used as part of a LINQ to Entities query, this method invokes the canonical VarP EDM function to calculate the variance for the population.
Public methodStatic memberVarP(IEnumerable<Nullable<Double>>)When used as part of a LINQ to Entities query, this method invokes the canonical VarP EDM function to calculate the variance for the population.
Public methodStatic memberVarP(IEnumerable<Nullable<Int32>>)When used as part of a LINQ to Entities query, this method invokes the canonical VarP EDM function to calculate the variance for the population.
Public methodStatic memberVarP(IEnumerable<Nullable<Int64>>)When used as part of a LINQ to Entities query, this method invokes the canonical VarP EDM function to calculate the variance for the population.
Top

Note that this class was called EntityFunctions in some previous versions of Entity Framework.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft