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