| | 1 | | // Copyright (c) ZeroC, Inc. |
| | 2 | |
|
| | 3 | | using IceRpc.RequestContext; |
| | 4 | |
|
| | 5 | | namespace IceRpc; |
| | 6 | |
|
| | 7 | | /// <summary>Provides an extension method for <see cref="Pipeline" /> to add the request context interceptor.</summary> |
| | 8 | | public static class RequestContextPipelineExtensions |
| | 9 | | { |
| | 10 | | /// <summary>Adds a <see cref="RequestContextInterceptor" /> to this pipeline.</summary> |
| | 11 | | /// <param name="pipeline">The pipeline being configured.</param> |
| | 12 | | /// <returns>The pipeline being configured.</returns> |
| | 13 | | /// <example> |
| | 14 | | /// The following code adds the request context interceptor to the invocation pipeline. |
| | 15 | | /// <code source="../../docfx/examples/IceRpc.RequestContext.Examples/RequestContextInterceptorExamples.cs" region=" |
| | 16 | | /// The following code shows how to set the request context feature with a Slice proxy. |
| | 17 | | /// <code source="../../docfx/examples/IceRpc.RequestContext.Examples/RequestContextInterceptorExamples.cs" region=" |
| | 18 | | /// The following code shows how to set the request context feature with a Protobuf client. |
| | 19 | | /// <code source="../../docfx/examples/IceRpc.RequestContext.Examples/RequestContextInterceptorExamples.cs" region=" |
| | 20 | | /// </example> |
| | 21 | | /// <seealso href="https://github.com/icerpc/icerpc-csharp/tree/main/examples/RequestContext"/> |
| | 22 | | public static Pipeline UseRequestContext(this Pipeline pipeline) => |
| 0 | 23 | | pipeline.Use(next => new RequestContextInterceptor(next)); |
| | 24 | | } |