3 instantiations of OperationContext
System.ServiceModel.Primitives (3)
System\ServiceModel\Dispatcher\ChannelHandler.cs (2)
282currentOperationContext = new OperationContext(request, message, channel); 1117OperationContext currentOperationContext = new OperationContext();
System\ServiceModel\OperationContextScope.cs (1)
29PushContext(new OperationContext(channel));
139 references to OperationContext
Binding.Http.IntegrationTests (7)
BasicHttpBindingTests.4.0.0.cs (2)
263OperationContext.Current.OutgoingMessageProperties.Add(HttpRequestMessageProperty.Name, httpReqMsgProp); 307OperationContext.Current.OutgoingMessageProperties.Add(HttpRequestMessageProperty.Name, httpReqMsgProp);
OperationContextTests.cs (5)
44Assert.Null(OperationContext.Current); 46Assert.NotNull(OperationContext.Current); 47var currentContext = OperationContext.Current; 51Assert.NotEqual(currentContext, OperationContext.Current);
Binding.ReliableSession.IntegrationTests (2)
NetHttpBindingTests.cs (1)
317OperationContext.Current.OutgoingMessageProperties.Add(HttpRequestMessageProperty.Name, httpRequestMessageProperty);
WSHttpBindingTests.cs (1)
317OperationContext.Current.OutgoingMessageProperties.Add(HttpRequestMessageProperty.Name, httpRequestMessageProperty);
Binding.Tcp.IntegrationTests (19)
OperationContextAsyncFlowTests.cs (19)
30Assert.Null(OperationContext.Current); 33Assert.NotNull(OperationContext.Current); 34var currentContext = OperationContext.Current; 38Assert.Equal(currentContext, OperationContext.Current); 65Assert.Null(OperationContext.Current); 68Assert.NotNull(OperationContext.Current); 69var firstContext = OperationContext.Current; 73Assert.Equal(firstContext, OperationContext.Current); 76Assert.NotEqual(firstContext, OperationContext.Current); 77var secondContext = OperationContext.Current; 81Assert.Equal(secondContext, OperationContext.Current); 83Assert.Equal(firstContext, OperationContext.Current); 85Assert.Null(OperationContext.Current); 159var opContext = OperationContext.Current; 164Assert.Equal(opContext, OperationContext.Current);
Client.ClientBase.IntegrationTests (6)
ClientBaseTests.4.0.0.cs (1)
783OperationContext.Current.OutgoingMessageHeaders.Add(header);
SessionTests.cs (5)
248var channel = OperationContext.Current.GetCallbackChannel<ISessionTestsDuplexService>(); 249var c = OperationContext.Current.Channel; 254OperationContext.Current.Channel.Closed += (sender, e) => 258OperationContext.Current.Channel.Closing += (sender, e) => 262OperationContext.Current.Channel.Faulted += (sender, e) =>
Contract.XmlSerializer.IntegrationTests (1)
XmlSerializerFormatTest.4.1.0.cs (1)
91OperationContext.Current.OutgoingMessageHeaders.Add(header);
dotnet-svcutil.xmlserializer.IntegrationTests (1)
src\System.Private.ServiceModel\tests\Scenarios\Contract\XmlSerializer\XmlSerializerFormatTest.4.1.0.cs (1)
91OperationContext.Current.OutgoingMessageHeaders.Add(header);
Security.TransportSecurity.IntegrationTests (12)
Http\ClientCredentialTypeTests.4.1.0.cs (6)
46if (!OperationContext.Current.OutgoingMessageProperties.ContainsKey(HttpRequestMessageProperty.Name)) 49OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = requestMessageProperty; 53requestMessageProperty = (HttpRequestMessageProperty)OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name]; 107if (!OperationContext.Current.OutgoingMessageProperties.ContainsKey(HttpRequestMessageProperty.Name)) 110OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = requestMessageProperty; 114requestMessageProperty = (HttpRequestMessageProperty)OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name];
Https\ClientCredentialTypeTests.4.1.0.cs (6)
61if (!OperationContext.Current.OutgoingMessageProperties.ContainsKey(HttpRequestMessageProperty.Name)) 64OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = requestMessageProperty; 68requestMessageProperty = (HttpRequestMessageProperty)OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name]; 136if (!OperationContext.Current.OutgoingMessageProperties.ContainsKey(HttpRequestMessageProperty.Name)) 139OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = requestMessageProperty; 143requestMessageProperty = (HttpRequestMessageProperty)OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name];
System.ServiceModel.Primitives (91)
System\ServiceModel\Channels\ServiceChannel.cs (9)
528OperationContext context = OperationContext.Current; 752ConcurrencyBehavior.UnlockInstanceBeforeCallout(OperationContext.Current); 773ConcurrencyBehavior.LockInstanceAfterCallout(OperationContext.Current); 968OperationContext operationContext = OperationContext.Current; 1172private void AddMessageProperties(Message message, OperationContext context) 1689private OperationContext _operationContext; 1703_operationContext = OperationContext.Current;
System\ServiceModel\Channels\ServiceChannelProxy.cs (14)
180OperationContext originalOperationContext = OperationContext.Current; 181OperationContext.Current = asyncResult.AsyncState as OperationContext; 185OperationContext.Current = originalOperationContext; 190OperationContext.Current = originalOperationContext; 197IAsyncResult ar = ServiceChannel.BeginCall(channel, operation, inputParameters, new AsyncCallback(endCallDelegate), OperationContext.Current); 220OperationContext originalOperationContext = OperationContext.Current; 221OperationContext.Current = asyncResult.AsyncState as OperationContext; 225OperationContext.Current = originalOperationContext; 230OperationContext.Current = originalOperationContext; 237IAsyncResult ar = ServiceChannel.BeginCall(channel, operation, inputParameters, new AsyncCallback(endCallDelegate), OperationContext.Current);
System\ServiceModel\Diagnostics\TraceUtility.cs (15)
110internal static string GetAnnotation(OperationContext context) 116internal static Guid GetReceivedActivityId(OperationContext operationContext) 165static internal void MessageFlowAtMessageReceived(Message message, OperationContext context, EventTraceActivity eventTraceActivity, bool createNewActivityId) 194context = OperationContext.Current; 274static internal string GetCallerInfo(OperationContext context) 290if (OperationContext.Current != null && activity != null) 292OperationContext.Current.OutgoingMessageProperties[TraceUtility.AsyncOperationActivityKey] = activity; 299if (OperationContext.Current != null && OperationContext.Current.OutgoingMessageProperties.TryGetValue(TraceUtility.AsyncOperationActivityKey, out data)) 301OperationContext.Current.OutgoingMessageProperties.Remove(TraceUtility.AsyncOperationActivityKey); 308if (OperationContext.Current != null) 310OperationContext.Current.OutgoingMessageProperties[TraceUtility.AsyncOperationStartTimeKey] = new EventTraceActivityTimeProperty(eventTraceActivity, startTime); 319if (OperationContext.Current != null && OperationContext.Current.OutgoingMessageProperties.TryGetValue(TraceUtility.AsyncOperationStartTimeKey, out data)) 321OperationContext.Current.OutgoingMessageProperties.Remove(TraceUtility.AsyncOperationStartTimeKey);
System\ServiceModel\Dispatcher\ChannelHandler.cs (7)
232private bool DispatchAndReleasePump(RequestContext request, bool cleanThread, OperationContext currentOperationContext) 672private bool HandleRequest(RequestContext request, OperationContext currentOperationContext) 1114OperationContext existingOperationContext = OperationContext.Current; 1117OperationContext currentOperationContext = new OperationContext(); 1118OperationContext.Current = currentOperationContext; 1145OperationContext.Current = existingOperationContext;
System\ServiceModel\Dispatcher\ConcurrencyBehavior.cs (2)
111internal static void UnlockInstanceBeforeCallout(OperationContext operationContext) 138internal static void LockInstanceAfterCallout(OperationContext operationContext)
System\ServiceModel\Dispatcher\DispatchRuntime.cs (4)
372ServiceChannel serviceChannel = OperationContext.Current.InternalServiceChannel; 373OperationContext.Current.OperationCompleted += 401OperationContext.Current.RequestContext.Close(); 402OperationContext.Current.RequestContext = null;
System\ServiceModel\Dispatcher\ImmutableDispatchRuntime.cs (1)
333private void AddMessageProperties(Message message, OperationContext context, ServiceChannel replyChannel)
System\ServiceModel\Dispatcher\MessageRpc.cs (6)
23internal readonly OperationContext OperationContext; 63OperationContext operationContext, InstanceContext instanceContext, EventTraceActivity eventTraceActivity) 408OperationContext originalContext; 411originalContext = OperationContext.Current; 423OperationContext.Current = OperationContext; 452OperationContext.Current = originalContext;
System\ServiceModel\Dispatcher\SyncMethodInvoker.cs (5)
99OperationContext context = OperationContext.Current; 118Guid activityId = TraceUtility.GetReceivedActivityId(OperationContext.Current); 127Guid activityId = ActivityIdHeader.ExtractActivityId(OperationContext.Current.IncomingMessage); 142WcfEventSource.Instance.OperationInvoked(eventTraceActivity, MethodName, TraceUtility.GetCallerInfo(OperationContext.Current));
System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (5)
161OperationContext context = OperationContext.Current; 180Guid activityId = TraceUtility.GetReceivedActivityId(OperationContext.Current); 189Guid activityId = ActivityIdHeader.ExtractActivityId(OperationContext.Current.IncomingMessage); 207TraceUtility.GetCallerInfo(OperationContext.Current));
System\ServiceModel\OperationContext.cs (8)
15public sealed class OperationContext : IExtensibleObject<OperationContext> 22s_asyncContext = new AsyncLocal<OperationContext>(); 28private static AsyncLocal<OperationContext> s_asyncContext; 31private ExtensionCollection<OperationContext> _extensions; 90public static OperationContext Current 155public IExtensionCollection<OperationContext> Extensions 161_extensions = new ExtensionCollection<OperationContext>(this); 402public OperationContext Context { get; set; }
System\ServiceModel\OperationContextScope.cs (13)
13if (!OperationContext.DisableAsyncFlow) 22private OperationContext _currentContext; 24private readonly OperationContext _originalContext = OperationContext.Current; 25private readonly OperationContextScope _originalScope = OperationContext.DisableAsyncFlow ? s_currentScope : s_asyncCurrentScope.Value; 32public OperationContextScope(OperationContext context) 46private void PushContext(OperationContext context) 49if (OperationContext.DisableAsyncFlow) 58OperationContext.Current = _currentContext; 63if ((OperationContext.DisableAsyncFlow ? s_currentScope : s_asyncCurrentScope.Value) != this) 68if (OperationContext.Current != _currentContext) 73if (OperationContext.DisableAsyncFlow) 82OperationContext.Current = _originalContext;
System\ServiceModel\Security\IdentityVerifier.cs (2)
221eventTraceActivity = EventTraceActivityHelper.TryExtractActivity((OperationContext.Current != null) ? OperationContext.Current.IncomingMessage : null);