İngilizce dilinde oku

Aracılığıyla paylaş


TransactionOption Sabit listesi

Tanım

Bileşen tarafından istenen otomatik işlem türünü belirtir.

C#
[System.Serializable]
public enum TransactionOption
Devralma
TransactionOption
Öznitelikler

Alanlar

Name Değer Description
Disabled 0

Geçerli bağlamdaki tüm işlemleri yoksayar.

NotSupported 1

Bileşeni, idare eden bir işlem olmadan bir bağlamda oluşturur.

Required 3

Varsa bir işlemi paylaşır ve gerekirse yeni bir işlem oluşturur.

RequiresNew 4

Geçerli bağlamın durumundan bağımsız olarak bileşeni yeni bir işlemle oluşturur.

Supported 2

Varsa, bir işlemi paylaşır.

Örnekler

Aşağıdaki kod örneğinde türün kullanımı gösterilmektedir TransactionOption .

C#
using System;
using System.EnterpriseServices;
using System.Reflection;

// References:
// System.EnterpriseServices

// An instance of this class will not participate in transactions, but can
// share its caller's context even if its caller is configured as
// NotSupported, Supported, Required, or RequiresNew.
[Transaction(TransactionOption.Disabled)]
public class TransactionAttribute_TransactionDisabled : ServicedComponent
{
}

// An instance of this class will not participate in transactions, and will
// share its caller's context only if its caller is also configured as
// NotSupported.
[Transaction(TransactionOption.NotSupported)]
public class TransactionAttribute_TransactionNotSupported : ServicedComponent
{
}

// An instance of this class will participate in its caller's transaction
// if one exists.
[Transaction(TransactionOption.Supported)]
public class TransactionAttribute_TransactionSupported : ServicedComponent
{
}

// An instance of this class will participate in its caller's transaction
// if one exists. If not, a new transaction will be created for it.
[Transaction(TransactionOption.Required)]
public class TransactionAttribute_TransactionRequired : ServicedComponent
{
}

// A new transaction will always be created for an instance of this class.
[Transaction(TransactionOption.RequiresNew)]
public class TransactionAttribute_TransactionRequiresNew : ServicedComponent
{
}

Açıklamalar

.NET Yükleme Aracı (Regsvcs.exe) kullanılırken, varsayılan ServicedComponent olarak işlem seçeneği kullanılır Disabled.

Şunlara uygulanır

Ürün Sürümler
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1