語言

ParameterBuilder.Boolean 方法

定義

建立一個新的參數定義來傳遞布林資料。

實體框架遷移 API 並非設計用來接受不受信任來源(例如應用程式的最終使用者)提供的輸入。 若接受來自這些來源的輸入,應在傳遞給這些 API 前進行驗證,以防止 SQL 注入攻擊等攻擊。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
public System.Data.Entity.Migrations.Model.ParameterModel Boolean(Nullable<bool> defaultValue = null, string defaultValueSql = null, string name = null, string storeType = null, bool outParameter = false);
member this.Boolean : Nullable<bool> * string * string * string * bool -> System.Data.Entity.Migrations.Model.ParameterModel
Public Function Boolean (Optional defaultValue As Nullable(Of Boolean) = null, Optional defaultValueSql As String = null, Optional name As String = null, Optional storeType As String = null, Optional outParameter As Boolean = false) As ParameterModel

參數

defaultValue
Nullable<Boolean>

常數值作為此參數的預設值。

defaultValueSql
String

SQL 表達式作為此參數的預設值。

name
String

參數的名稱。

storeType
String

此參數需使用提供者專用的資料型別。

outParameter
Boolean

一個表示參數是否為輸出參數的值。

傳回

新建構的參數定義。

屬性

適用於