/// <summary> /// Applies common settings from the parameters to the given writer settings. /// </summary> /// <param name="writerSettings">The writer settings to modify.</param> /// <param name="serviceUri">The service URI.</param> /// <param name="responseVersion">The response version.</param> /// <param name="dataService">The data service.</param> /// <param name="responseMessage">The response message.</param> internal static void ApplyCommonSettings(ODataMessageWriterSettings writerSettings, Uri serviceUri, Version responseVersion, IDataService dataService, IODataResponseMessage responseMessage) { writerSettings.Version = CommonUtil.ConvertToODataVersion(responseVersion); writerSettings.PayloadBaseUri = serviceUri; writerSettings.EnableODataServerBehavior( dataService.Configuration.DataServiceBehavior.AlwaysUseDefaultXmlNamespaceForRootElement); writerSettings.DisableMessageStreamDisposal = responseMessage is AstoriaResponseMessage; }