本文整理汇总了C#中MessageProperties.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# MessageProperties.Remove方法的具体用法?C# MessageProperties.Remove怎么用?C# MessageProperties.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageProperties
的用法示例。
在下文中一共展示了MessageProperties.Remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FilterProperties
static void FilterProperties(MessageProperties destination)
{
// We have the clear out the HTTP Req/Resp props, so we don't accidentally
// tell the outbound binding to use whatever Content-Type/Method/QueryString
// that the inboudnd message/response used. Otherwise BasicHttp<->WsHttp won't work.
object incomingHttpRequest;
if (destination.TryGetValue(HttpRequestMessageProperty.Name, out incomingHttpRequest))
{
//Store the inbound value for later retoration
destination[IncomingHttpRequestName] = incomingHttpRequest;
destination.Remove(HttpRequestMessageProperty.Name);
}
destination.Remove(HttpResponseMessageProperty.Name);
//Preserve the Via on the outbound message, HTTP Context using cookies looks at this value
//on the original request when sending the response "Set-Cookie" header.
Uri incomingVia = destination.Via;
if (incomingVia != null)
{
destination[IncomingViaName] = incomingVia;
}
}