편집

다음을 통해 공유


InstanceContext.Extensions Property

Definition

Gets the extension collection, if any, associated with the service instance.

public:
 property System::ServiceModel::IExtensionCollection<System::ServiceModel::InstanceContext ^> ^ Extensions { System::ServiceModel::IExtensionCollection<System::ServiceModel::InstanceContext ^> ^ get(); };
public System.ServiceModel.IExtensionCollection<System.ServiceModel.InstanceContext> Extensions { get; }
member this.Extensions : System.ServiceModel.IExtensionCollection<System.ServiceModel.InstanceContext>
Public ReadOnly Property Extensions As IExtensionCollection(Of InstanceContext)

Property Value

The IExtensionCollection<T> of type InstanceContext that contains the instance contexts for the extensions of the service instance.

Implements

Exceptions

The service instance associated with this context is closed, but was not aborted.

The service instance associated with this context is in a faulted state.

Examples

The following code shows how to access the Extensions property:

Uri baseAddress = new Uri("http://localhost:8000/ServiceModelSamples/service");
CalculatorService service = new CalculatorService();
ServiceHost serviceHost = new ServiceHost(service, baseAddress);
InstanceContext instanceContext = new InstanceContext(serviceHost, service);

IExtensionCollection<InstanceContext> extensions = instanceContext.Extensions;

Applies to