SqlServerDbFunctionsExtensions 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供 CLR 方法,當用於 LINQ 到 Entities 查詢時,這些方法會被轉換成資料庫函式。 此類別上的方法可透過 Functions存取。
[System.Runtime.CompilerServices.Nullable(0)]
public static class SqlServerDbFunctionsExtensions
public static class SqlServerDbFunctionsExtensions
[<System.Runtime.CompilerServices.Nullable(0)>]
type SqlServerDbFunctionsExtensions = class
type SqlServerDbFunctionsExtensions = class
Public Module SqlServerDbFunctionsExtensions
- 繼承
-
SqlServerDbFunctionsExtensions
- 屬性
備註
更多資訊與範例請參閱「資料庫函數」及「使用 EF Core 存取 SQL Server 與 Azure SQL 資料庫」。
方法
| 名稱 | Description |
|---|---|
| AtTimeZone(DbFunctions, DateTime, String) |
轉換為 |
| AtTimeZone(DbFunctions, DateTimeOffset, String) |
轉換為 |
| Contains(DbFunctions, Object, String, Int32) |
一個可用於 LINQ 查詢的 DbFunction 方法存根,以鎖定 SQL Server |
| Contains(DbFunctions, Object, String) |
一個可用於 LINQ 查詢的 DbFunction 方法存根,以鎖定 SQL Server |
| Contains(DbFunctions, String, String, Int32) |
一個可用於 LINQ 查詢的 DbFunction 方法存根,以鎖定 SQL Server CONTAINS 的 store 函式。 |
| Contains(DbFunctions, String, String) |
一個可用於 LINQ 查詢的 DbFunction 方法存根,以鎖定 SQL Server CONTAINS 的 store 函式。 |
| DataLength(DbFunctions, Byte[]) |
傳回用來表示任何表達式的位元組數目。 |
| DataLength(DbFunctions, Nullable<Boolean>) |
傳回用來表示任何表達式的位元組數目。 |
| DataLength(DbFunctions, Nullable<DateTime>) |
傳回用來表示任何表達式的位元組數目。 |
| DataLength(DbFunctions, Nullable<DateTimeOffset>) |
傳回用來表示任何表達式的位元組數目。 |
| DataLength(DbFunctions, Nullable<Decimal>) |
傳回用來表示任何表達式的位元組數目。 |
| DataLength(DbFunctions, Nullable<Double>) |
傳回用來表示任何表達式的位元組數目。 |
| DataLength(DbFunctions, Nullable<Guid>) |
傳回用來表示任何表達式的位元組數目。 |
| DataLength(DbFunctions, Nullable<TimeSpan>) |
傳回用來表示任何表達式的位元組數目。 |
| DataLength(DbFunctions, String) |
傳回用來表示任何表達式的位元組數目。 |
| 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, DateOnly, DateOnly) |
計算與之間穿越 |
| DateDiffHour(DbFunctions, DateTime, DateTime) |
計算與之間穿越 |
| DateDiffHour(DbFunctions, DateTimeOffset, DateTimeOffset) |
計算與之間穿越 |
| DateDiffHour(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
計算與之間穿越 |
| DateDiffHour(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
計算與之間穿越 |
| DateDiffHour(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
計算與之間穿越 |
| DateDiffHour(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>) |
計算與之間穿越 |
| DateDiffHour(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>) |
計算與之間穿越 |
| DateDiffHour(DbFunctions, TimeOnly, TimeOnly) |
計算與之間穿越 |
| DateDiffHour(DbFunctions, TimeSpan, TimeSpan) |
計算與之間穿越 |
| DateDiffMicrosecond(DbFunctions, DateOnly, DateOnly) |
計算與之間穿越 |
| DateDiffMicrosecond(DbFunctions, DateTime, DateTime) |
計算與之間穿越 |
| DateDiffMicrosecond(DbFunctions, DateTimeOffset, DateTimeOffset) |
計算與之間穿越 |
| DateDiffMicrosecond(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
計算與之間穿越 |
| DateDiffMicrosecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
計算與之間穿越 |
| DateDiffMicrosecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
計算與之間穿越 |
| DateDiffMicrosecond(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>) |
計算與之間穿越 |
| DateDiffMicrosecond(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>) |
計算與之間穿越 |
| DateDiffMicrosecond(DbFunctions, TimeOnly, TimeOnly) |
計算與之間穿越 |
| DateDiffMicrosecond(DbFunctions, TimeSpan, TimeSpan) |
計算與之間穿越 |
| DateDiffMillisecond(DbFunctions, DateOnly, DateOnly) |
計算與之間穿越 |
| DateDiffMillisecond(DbFunctions, DateTime, DateTime) |
計算與之間穿越 |
| DateDiffMillisecond(DbFunctions, DateTimeOffset, DateTimeOffset) |
計算與之間穿越 |
| DateDiffMillisecond(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
計算與之間穿越 |
| DateDiffMillisecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
計算與之間穿越 |
| DateDiffMillisecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
計算與之間穿越 |
| DateDiffMillisecond(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>) |
計算與之間穿越 |
| DateDiffMillisecond(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>) |
計算與之間穿越 |
| DateDiffMillisecond(DbFunctions, TimeOnly, TimeOnly) |
計算與之間穿越 |
| DateDiffMillisecond(DbFunctions, TimeSpan, TimeSpan) |
計算與之間穿越 |
| DateDiffMinute(DbFunctions, DateOnly, DateOnly) |
計算在與 |
| DateDiffMinute(DbFunctions, DateTime, DateTime) |
計算在與 |
| DateDiffMinute(DbFunctions, DateTimeOffset, DateTimeOffset) |
計算在與 |
| DateDiffMinute(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
計算在與 |
| DateDiffMinute(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
計算在與 |
| DateDiffMinute(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
計算在與 |
| DateDiffMinute(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>) |
計算在與 |
| DateDiffMinute(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>) |
計算在與 |
| DateDiffMinute(DbFunctions, TimeOnly, TimeOnly) |
計算在與 |
| DateDiffMinute(DbFunctions, TimeSpan, TimeSpan) |
計算在與 |
| 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>) |
計算與 之間跨 |
| DateDiffNanosecond(DbFunctions, DateOnly, DateOnly) |
計算與之間穿越 |
| DateDiffNanosecond(DbFunctions, DateTime, DateTime) |
計算與之間穿越 |
| DateDiffNanosecond(DbFunctions, DateTimeOffset, DateTimeOffset) |
計算與之間穿越 |
| DateDiffNanosecond(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
計算與之間穿越 |
| DateDiffNanosecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
計算與之間穿越 |
| DateDiffNanosecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
計算與之間穿越 |
| DateDiffNanosecond(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>) |
計算與之間穿越 |
| DateDiffNanosecond(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>) |
計算與之間穿越 |
| DateDiffNanosecond(DbFunctions, TimeOnly, TimeOnly) |
計算與之間穿越 |
| DateDiffNanosecond(DbFunctions, TimeSpan, TimeSpan) |
計算與之間穿越 |
| DateDiffSecond(DbFunctions, DateOnly, DateOnly) |
計算 與 |
| DateDiffSecond(DbFunctions, DateTime, DateTime) |
計算 與 |
| DateDiffSecond(DbFunctions, DateTimeOffset, DateTimeOffset) |
計算 與 |
| DateDiffSecond(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
計算 與 |
| DateDiffSecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
計算 與 |
| DateDiffSecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
計算 與 |
| DateDiffSecond(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>) |
計算 與 |
| DateDiffSecond(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>) |
計算 與 |
| DateDiffSecond(DbFunctions, TimeOnly, TimeOnly) |
計算 與 |
| DateDiffSecond(DbFunctions, TimeSpan, TimeSpan) |
計算 與 |
| DateDiffWeek(DbFunctions, DateOnly, DateOnly) |
計算與 之間跨 |
| DateDiffWeek(DbFunctions, DateTime, DateTime) |
計算與 之間跨 |
| DateDiffWeek(DbFunctions, DateTimeOffset, DateTimeOffset) |
計算與 之間跨 |
| DateDiffWeek(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
計算與 之間跨 |
| DateDiffWeek(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
計算與 之間跨 |
| DateDiffWeek(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>) |
計算與 之間跨 |
| DateFromParts(DbFunctions, Int32, Int32, Int32) |
初始化結構的新實例 DateTime 至指定的年份、月份、日期。
對應於 SQL Server |
| DateTime2FromParts(DbFunctions, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32) |
初始化結構的新實例 DateTime ,設定為指定的年份、月份、日、時、分、秒、分數及精度。
對應於 SQL Server |
| DateTimeFromParts(DbFunctions, Int32, Int32, Int32, Int32, Int32, Int32, Int32) |
初始化結構的新實例 DateTime ,設定為指定的年份、月份、日、時、分、秒和毫秒。
對應於 SQL Server |
| DateTimeOffsetFromParts(DbFunctions, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32) |
初始化結構的新實例 DateTimeOffset ,設定為指定的年份、月份、日、時、分鐘、秒、分數、小時偏移、分鐘偏移及精確度。
對應於 SQL Server
|
| DateTrunc(DbFunctions, String, DateOnly) |
將 |
| DateTrunc(DbFunctions, String, DateTime) |
將 |
| DateTrunc(DbFunctions, String, DateTimeOffset) |
將 |
| DateTrunc(DbFunctions, String, Nullable<DateOnly>) |
將 |
| DateTrunc(DbFunctions, String, Nullable<DateTime>) |
將 |
| DateTrunc(DbFunctions, String, Nullable<DateTimeOffset>) |
將 |
| DateTrunc(DbFunctions, String, Nullable<TimeOnly>) |
將 |
| DateTrunc(DbFunctions, String, TimeOnly) |
將 |
| FreeText(DbFunctions, Object, String, Int32) |
一個可用於 LINQ 查詢的 DbFunction 方法存根,以鎖定 SQL Server |
| FreeText(DbFunctions, Object, String) |
一個可用於 LINQ 查詢的 DbFunction 方法存根,以鎖定 SQL Server |
| FreeText(DbFunctions, String, String, Int32) |
一個可用於 LINQ 查詢的 DbFunction 方法存根,以鎖定 SQL Server 的 FREETEXT store 函式。 |
| FreeText(DbFunctions, String, String) |
一個可用於 LINQ 查詢的 DbFunction 方法存根,以鎖定 SQL Server 的 FREETEXT store 函式。 |
| IsDate(DbFunctions, String) |
驗證給定字串是否為有效日期。
對應於 SQL Server |
| IsNumeric(DbFunctions, String) |
驗證給定字串是否為有效數值。
對應於 SQL Server |
| JsonContains(DbFunctions, Object, Object, String, Nullable<Int32>) |
一個可用於 LINQ 查詢的 DbFunction 方法存根,以鎖定 SQL Server |
| PatIndex(DbFunctions, String, String) |
回傳指定表達式中模式首次出現的起始位置,若找不到該模式則為零,適用於所有有效的文字與字元資料型別。 |
| SmallDateTimeFromParts(DbFunctions, Int32, Int32, Int32, Int32, Int32) |
初始化結構的新實例 DateTime ,設定為指定的年份、月份、日、時與分鐘。
對應於 SQL Server |
| StandardDeviationPopulation(DbFunctions, IEnumerable<Byte>) |
回傳指定表達式中所有值的母體標準差。
對應於 SQL Server |
| StandardDeviationPopulation(DbFunctions, IEnumerable<Decimal>) |
回傳指定表達式中所有值的母體標準差。
對應於 SQL Server |
| StandardDeviationPopulation(DbFunctions, IEnumerable<Double>) |
回傳指定表達式中所有值的母體標準差。
對應於 SQL Server |
| StandardDeviationPopulation(DbFunctions, IEnumerable<Int16>) |
回傳指定表達式中所有值的母體標準差。
對應於 SQL Server |
| StandardDeviationPopulation(DbFunctions, IEnumerable<Int32>) |
回傳指定表達式中所有值的母體標準差。
對應於 SQL Server |
| StandardDeviationPopulation(DbFunctions, IEnumerable<Int64>) |
回傳指定表達式中所有值的母體標準差。
對應於 SQL Server |
| StandardDeviationPopulation(DbFunctions, IEnumerable<Single>) |
回傳指定表達式中所有值的母體標準差。
對應於 SQL Server |
| StandardDeviationSample(DbFunctions, IEnumerable<Byte>) |
回傳指定表達式中所有值的樣本標準差。
對應於 SQL Server |
| StandardDeviationSample(DbFunctions, IEnumerable<Decimal>) |
回傳指定表達式中所有值的樣本標準差。
對應於 SQL Server |
| StandardDeviationSample(DbFunctions, IEnumerable<Double>) |
回傳指定表達式中所有值的樣本標準差。
對應於 SQL Server |
| StandardDeviationSample(DbFunctions, IEnumerable<Int16>) |
回傳指定表達式中所有值的樣本標準差。
對應於 SQL Server |
| StandardDeviationSample(DbFunctions, IEnumerable<Int32>) |
回傳指定表達式中所有值的樣本標準差。
對應於 SQL Server |
| StandardDeviationSample(DbFunctions, IEnumerable<Int64>) |
回傳指定表達式中所有值的樣本標準差。
對應於 SQL Server |
| StandardDeviationSample(DbFunctions, IEnumerable<Single>) |
回傳指定表達式中所有值的樣本標準差。
對應於 SQL Server |
| TimeFromParts(DbFunctions, Int32, Int32, Int32, Int32, Int32) |
初始化結構的新實例 TimeSpan ,設定為指定的時、分、秒、分數及精度。 對應於 SQL Server |
| VariancePopulation(DbFunctions, IEnumerable<Byte>) |
回傳指定表達式中所有值的母體變異數。
對應於 SQL Server |
| VariancePopulation(DbFunctions, IEnumerable<Decimal>) |
回傳指定表達式中所有值的母體變異數。
對應於 SQL Server |
| VariancePopulation(DbFunctions, IEnumerable<Double>) |
回傳指定表達式中所有值的母體變異數。
對應於 SQL Server |
| VariancePopulation(DbFunctions, IEnumerable<Int16>) |
回傳指定表達式中所有值的母體變異數。
對應於 SQL Server |
| VariancePopulation(DbFunctions, IEnumerable<Int32>) |
回傳指定表達式中所有值的母體變異數。
對應於 SQL Server |
| VariancePopulation(DbFunctions, IEnumerable<Int64>) |
回傳指定表達式中所有值的母體變異數。
對應於 SQL Server |
| VariancePopulation(DbFunctions, IEnumerable<Single>) |
回傳指定表達式中所有值的母體變異數。
對應於 SQL Server |
| VarianceSample(DbFunctions, IEnumerable<Byte>) |
回傳指定表達式中所有值的樣本變異數。
對應於 SQL Server |
| VarianceSample(DbFunctions, IEnumerable<Decimal>) |
回傳指定表達式中所有值的樣本變異數。
對應於 SQL Server |
| VarianceSample(DbFunctions, IEnumerable<Double>) |
回傳指定表達式中所有值的樣本變異數。
對應於 SQL Server |
| VarianceSample(DbFunctions, IEnumerable<Int16>) |
回傳指定表達式中所有值的樣本變異數。
對應於 SQL Server |
| VarianceSample(DbFunctions, IEnumerable<Int32>) |
回傳指定表達式中所有值的樣本變異數。
對應於 SQL Server |
| VarianceSample(DbFunctions, IEnumerable<Int64>) |
回傳指定表達式中所有值的樣本變異數。
對應於 SQL Server |
| VarianceSample(DbFunctions, IEnumerable<Single>) |
回傳指定表達式中所有值的樣本變異數。
對應於 SQL Server |
| VectorDistance<T>(DbFunctions, String, SqlVector<T>, SqlVector<T>) |
使用指定的距離計量計算兩個向量之間的距離。 |