/// <summary>
        /// Sets the 'DataServiceVersion' HTTP header on the message based on the protocol version specified in the settings.
        /// </summary>
        /// <param name="message">The message to set the data service version header on.</param>
        /// <param name="settings">The <see cref="ODataMessageWriterSettings"/> determining the protocol version to use.</param>
        internal static void SetDataServiceVersion(ODataMessage message, ODataMessageWriterSettings settings)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(message != null, "message != null");
            Debug.Assert(settings != null, "settings != null");
            Debug.Assert(settings.Version.HasValue, "settings.Version.HasValue");

            string dataServiceVersionString = ODataUtils.ODataVersionToString(settings.Version.Value) + ";";
            message.SetHeader(ODataConstants.DataServiceVersionHeader, dataServiceVersionString);
        }
示例#2
0
        /// <summary>
        /// Sets the 'DataServiceVersion' HTTP header on the message based on the protocol version specified in the settings.
        /// </summary>
        /// <param name="message">The message to set the data service version header on.</param>
        /// <param name="settings">The <see cref="ODataMessageWriterSettings"/> determining the protocol version to use.</param>
        internal static void SetDataServiceVersion(ODataMessage message, ODataMessageWriterSettings settings)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(message != null, "message != null");
            Debug.Assert(settings != null, "settings != null");
            Debug.Assert(settings.Version.HasValue, "settings.Version.HasValue");

            string dataServiceVersionString = ODataUtils.ODataVersionToString(settings.Version.Value) + ";";

            message.SetHeader(ODataConstants.DataServiceVersionHeader, dataServiceVersionString);
        }
示例#3
0
        internal static void SetDataServiceVersion(ODataMessage message, ODataMessageWriterSettings settings)
        {
            string headerValue = ODataUtils.ODataVersionToString(settings.Version.Value) + ";";

            message.SetHeader("DataServiceVersion", headerValue);
        }
示例#4
0
 internal static void SetDataServiceVersion(ODataMessage message, ODataMessageWriterSettings settings)
 {
     string headerValue = ODataUtils.ODataVersionToString(settings.Version.Value) + ";";
     message.SetHeader("DataServiceVersion", headerValue);
 }