IContextManager 인터페이스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
채널에서 컨텍스트를 가져오고 설정할 수 있는 인터페이스를 정의합니다.
public interface class IContextManager
public interface IContextManager
type IContextManager = interface
Public Interface IContextManager
설명
값을 설정 하 여를 사용 하는 채널의 경우를 WSHttpContextBinding NotAllowed 사용 하 여 클라이언트에서 컨텍스트를 검색할 수 없습니다 IContextManager GetProperty .이는 NotAllowed 채널에 의미 체계를 적용 하기 위해가 호출 될 때마다 세션을 설정 하는 새 채널이 생성 되기 때문입니다. 즉,이 경우 컨텍스트가 클라이언트에 올바르게 다시 전파 되더라도를 사용 하 여 검색할 수 없습니다 IContextManager . 다음 코드와 같이를 사용 하 여 검색할 수 있습니다 ContextMessageProperty .
using (new OperationContextScope((IContextChannel)channel))
{
channel.MyChannel("Test");
ContextMessageProperty context;
if (ContextMessageProperty.TryGet(OperationContext.Current.IncomingMessageProperties, out context))
{
Console.WriteLine(context.Count);
}
}
속성
| Enabled |
컨텍스트 관리를 사용하도록 설정했는지 여부를 나타내는 값을 가져오거나 설정합니다. |
메서드
| GetContext() |
컨텍스트를 가져옵니다. |
| SetContext(IDictionary<String,String>) |
컨텍스트를 설정합니다. |