共用方式為


DbContextConfiguration.EnsureTransactionsForFunctionsAndCommands 屬性

[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]

取得或設定值,以指定交易中是否一律要執行 SQL 函式及命令。

命名空間:  System.Data.Entity.Infrastructure
組件:  EntityFramework (在 EntityFramework.dll 中)

語法

'宣告
Public Property EnsureTransactionsForFunctionsAndCommands As Boolean 
    Get 
    Set
'用途
Dim instance As DbContextConfiguration 
Dim value As Boolean 

value = instance.EnsureTransactionsForFunctionsAndCommands

instance.EnsureTransactionsForFunctionsAndCommands = value
public bool EnsureTransactionsForFunctionsAndCommands { get; set; }
public:
property bool EnsureTransactionsForFunctionsAndCommands {
    bool get ();
    void set (bool value);
}
member EnsureTransactionsForFunctionsAndCommands : bool with get, set
function get EnsureTransactionsForFunctionsAndCommands () : boolean 
function set EnsureTransactionsForFunctionsAndCommands (value : boolean)

屬性值

類型:System.Boolean
預設的交易行為。

備註

這個旗標指定當方法 (例如 ExecuteSqlCommand(String, Object[])) 在交易外部執行時,是否要啟動新的交易。 請注意,這不會變更 SaveChanges() 的行為。

請參閱

參考

DbContextConfiguration 類別

System.Data.Entity.Infrastructure 命名空間