当前位置: 首页>>代码示例>>C#>>正文


C# IODataRequestMessage.GetStream方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:12,代码来源:MediaStreamHandler.cs

示例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();
        }
开发者ID:nickchal,项目名称:pash,代码行数:20,代码来源:BatchServiceHost.cs

示例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();
        }
开发者ID:larsenjo,项目名称:odata.net,代码行数:34,代码来源:BatchServiceHost.cs


注:本文中的IODataRequestMessage.GetStream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。