/// <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)); }
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)); }
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); }