ContractDescription.Behaviors Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the behaviors associated with the contract description.

Namespace:   System.ServiceModel.Description
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public KeyedByTypeCollection<IContractBehavior> Behaviors { get; }

Property Value

Type: System.Collections.Generic.KeyedByTypeCollection<IContractBehavior>

The KeyedByTypeCollection<TItem> of type IContractBehavior associated with the contract description.

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

.NET Framework
Available since 3.0
Silverlight
Available since 4.0
Return to top
Show: