コード例 #1
0
ファイル: Serializer.cs プロジェクト: tapika/swupd
        /// <summary>
        /// Creates an instance of ODataMessageWriter.
        /// </summary>
        /// <param name="requestMessage">Instance of IODataRequestMessage.</param>
        /// <param name="requestInfo">RequestInfo containing information about the client settings.</param>
        /// <param name="isParameterPayload">true if the writer is intended to for a parameter payload, false otherwise.</param>
        /// <returns>An instance of ODataMessageWriter.</returns>
        internal static ODataMessageWriter CreateMessageWriter(ODataRequestMessageWrapper requestMessage, RequestInfo requestInfo, bool isParameterPayload)
        {
            var writerSettings = requestInfo.WriteHelper.CreateSettings(
                Serializer.StartEntryXmlCustomizer,
                Serializer.EndEntryXmlCustomizer,
                requestMessage.IsBatchPartRequest);

            return(requestMessage.CreateWriter(writerSettings, isParameterPayload));
        }
コード例 #2
0
        internal static ODataMessageWriter CreateMessageWriter(ODataRequestMessageWrapper requestMessage, RequestInfo requestInfo)
        {
            ODataMessageWriterSettings writerSettings = new ODataMessageWriterSettings {
                CheckCharacters = false,
                Indent          = false,
                DisableMessageStreamDisposal = !requestMessage.IsBatchPartRequest
            };

            if (requestInfo.HasWritingEventHandlers)
            {
                writerSettings.EnableWcfDataServicesClientBehavior(new Func <ODataEntry, XmlWriter, XmlWriter>(Serializer.StartEntryXmlCustomizer), new Action <ODataEntry, XmlWriter, XmlWriter>(Serializer.EndEntryXmlCustomizer), requestInfo.DataNamespace, requestInfo.TypeScheme.AbsoluteUri);
            }
            else
            {
                writerSettings.EnableWcfDataServicesClientBehavior(null, null, requestInfo.DataNamespace, requestInfo.TypeScheme.AbsoluteUri);
            }
            return(requestMessage.CreateWriter(writerSettings));
        }
コード例 #3
0
ファイル: Serializer.cs プロジェクト: nickchal/pash
 internal static ODataMessageWriter CreateMessageWriter(ODataRequestMessageWrapper requestMessage, RequestInfo requestInfo)
 {
     ODataMessageWriterSettings writerSettings = new ODataMessageWriterSettings {
         CheckCharacters = false,
         Indent = false,
         DisableMessageStreamDisposal = !requestMessage.IsBatchPartRequest
     };
     if (requestInfo.HasWritingEventHandlers)
     {
         writerSettings.EnableWcfDataServicesClientBehavior(new Func<ODataEntry, XmlWriter, XmlWriter>(Serializer.StartEntryXmlCustomizer), new Action<ODataEntry, XmlWriter, XmlWriter>(Serializer.EndEntryXmlCustomizer), requestInfo.DataNamespace, requestInfo.TypeScheme.AbsoluteUri);
     }
     else
     {
         writerSettings.EnableWcfDataServicesClientBehavior(null, null, requestInfo.DataNamespace, requestInfo.TypeScheme.AbsoluteUri);
     }
     return requestMessage.CreateWriter(writerSettings);
 }