-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIOperationContextState.cs
29 lines (27 loc) · 1.01 KB
/
IOperationContextState.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
namespace WcfApplicationInsights
{
using System;
using System.Collections.Generic;
using System.Text;
/// <summary>
/// Allows a TelemetryModule or TelemetryInitializer to store temporary
/// state between request/response processing.
/// </summary>
public interface IOperationContextState
{
/// <summary>
/// Store a value in the context.
/// </summary>
/// <param name="key">The key to store the state under.</param>
/// <param name="value">The value to store.</param>
void SetState(string key, object value);
/// <summary>
/// Retrieve a value from the context.
/// </summary>
/// <typeparam name="T">The type of value.</typeparam>
/// <param name="key">The key the state is stored under.</param>
/// <param name="value">The value, if found.</param>
/// <returns>True if the specified key was found, false otherwise.</returns>
bool TryGetState<T>(string key, out T value);
}
}