本文整理汇总了C#中IODataRequestMessage.GetStream方法的典型用法代码示例。如果您正苦于以下问题:C# IODataRequestMessage.GetStream方法的具体用法?C# IODataRequestMessage.GetStream怎么用?C# IODataRequestMessage.GetStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IODataRequestMessage
的用法示例。
在下文中一共展示了IODataRequestMessage.GetStream方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Process
public override void Process(IODataRequestMessage requestMessage, IODataResponseMessage responseMessage)
{
switch (this.HttpMethod)
{
case HttpMethod.POST:
this.ProcessCreate(requestMessage.GetStream(), responseMessage);
break;
case HttpMethod.PUT:
this.ProcessUpdate(requestMessage.GetStream(), responseMessage);
break;
}
}
示例2: BatchServiceHost
internal BatchServiceHost(Uri absoluteServiceUri, IODataRequestMessage operationMessage, string contentId, ODataBatchWriter writer, Version maxDataServiceVersion, Version minDataServiceVersion, Version dataServiceVersion) : this(writer)
{
this.absoluteServiceUri = absoluteServiceUri;
this.absoluteRequestUri = RequestUriProcessor.GetAbsoluteUriFromReference(operationMessage.Url, absoluteServiceUri, dataServiceVersion);
this.requestHttpMethod = operationMessage.Method;
this.contentId = contentId;
foreach (KeyValuePair<string, string> pair in operationMessage.Headers)
{
this.requestHeaders.Add(pair.Key, pair.Value);
}
if (string.IsNullOrEmpty(this.requestHeaders["MaxDataServiceVersion"]))
{
this.requestHeaders["MaxDataServiceVersion"] = maxDataServiceVersion.ToString();
}
if (string.IsNullOrEmpty(this.requestHeaders["MinDataServiceVersion"]))
{
this.requestHeaders["MinDataServiceVersion"] = minDataServiceVersion.ToString();
}
this.requestStream = operationMessage.GetStream();
}
示例3: BatchServiceHost
/// <summary>
/// Initializes a new dummy host for the batch request.
/// This host represents a single operation in the batch.
/// </summary>
/// <param name="absoluteServiceUri">Absolute Uri to the service.</param>
/// <param name="operationMessage">The request message representing a batch operation to wrap.</param>
/// <param name="contentId">Content id for the given operation host.</param>
/// <param name="writer">ODataBatchWriter instance.</param>
/// <param name="odataMaxVersion">OData-MaxVersion header on the batch request. If the OData-MaxVersion header is not specified in the current operation, we default to the MaxDSV from the batch level.</param>
internal BatchServiceHost(Uri absoluteServiceUri, IODataRequestMessage operationMessage, string contentId, ODataBatchWriter writer, Version odataMaxVersion)
: this(writer)
{
Debug.Assert(absoluteServiceUri != null && absoluteServiceUri.IsAbsoluteUri, "absoluteServiceUri != null && absoluteServiceUri.IsAbsoluteUri");
Debug.Assert(operationMessage != null, "operationMessage != null");
this.absoluteServiceUri = absoluteServiceUri;
this.absoluteRequestUri = RequestUriProcessor.GetAbsoluteUriFromReference(operationMessage.Url, absoluteServiceUri);
this.requestHttpMethod = operationMessage.Method;
this.contentId = contentId;
foreach (KeyValuePair<string, string> header in operationMessage.Headers)
{
this.requestHeaders.Add(header.Key, header.Value);
}
// If the MaxDSV header is not specified in the current operation, we default to the MaxDSV from the batch level.
if (string.IsNullOrEmpty(this.requestHeaders[XmlConstants.HttpODataMaxVersion]))
{
Debug.Assert(odataMaxVersion != null, "odataMaxVersion != null");
this.requestHeaders[XmlConstants.HttpODataMaxVersion] = odataMaxVersion.ToString();
}
this.requestStream = operationMessage.GetStream();
}