ContractDescription.Behaviors 屬性

定義

取得與合約描述關聯的行為。

C#
public System.Collections.Generic.KeyedByTypeCollection<System.ServiceModel.Description.IContractBehavior> Behaviors { get; }

屬性值

與合約描述關聯之 KeyedByTypeCollection<TItem> 型別的 IContractBehavior

範例

C#
KeyedByTypeCollection<IContractBehavior> behaviors = cd.Behaviors;
Console.WriteLine("\tDisplay all behaviors:");
foreach (IContractBehavior behavior in behaviors)
{
    Console.WriteLine("\t\t" + behavior.ToString());
}

適用於

產品 版本
.NET 8
.NET Framework 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