/// <summary> /// Initialises a new instance of the <see cref="FormatQueryOption"/> class. /// </summary> /// <param name="rawValue">The raw request value.</param> internal FormatQueryOption(string rawValue) : base(rawValue) { string format = rawValue.SubstringBefore(';'); switch (format) { case "$format=json": case "$format=application/json": MediaTypeHeaderValue = s_json; break; default: string value = format.SubstringAfter('='); throw ODataException.NotAcceptable(ExceptionMessage.QueryOptionValueNotSupported("$format", value, "'json, application/json'"), "$format"); } }