/// <summary> /// Initializes a new instance of the <see cref="PayloadMetadataParameterInterpreter"/> class. /// NOTE: This constructor is for unit-testing only. /// </summary> /// <param name="format">The response format.</param> /// <param name="rawParameterValue">The parameter value.</param> internal PayloadMetadataParameterInterpreter(ODataFormat format, string rawParameterValue) { this.isJsonLight = format == ODataFormat.Json; // NOTE: we explicitly allow the format passed in to be null, because it implies that no response payload // can possibly be written. In this case, it is treated exactly the same as any other non-json-light format. if (this.isJsonLight) { this.metadataParameterValue = ParseMetadataParameterForJsonLight(rawParameterValue); this.metadataParameterValueForTypeNames = this.metadataParameterValue; } else { Debug.Assert(rawParameterValue == null || rawParameterValue == "verbose", "Only JSON-Light allows the the amount of metadata to be controlled."); this.metadataParameterValue = MetadataParameterValue.Full; this.metadataParameterValueForTypeNames = MetadataParameterValue.Minimal; } }
/// <summary> /// Initializes a new instance of the <see cref="PayloadMetadataParameterInterpreter"/> class. /// NOTE: This constructor is for unit-testing only. /// </summary> /// <param name="format">The response format.</param> /// <param name="rawParameterValue">The parameter value.</param> internal PayloadMetadataParameterInterpreter(ODataFormat format, string rawParameterValue) { this.isJsonLight = format == ODataFormat.Json; // NOTE: we explicitly allow the format passed in to be null, because it implies that no response payload // can possibly be written. In this case, it is treated exactly the same as any other non-json-light format. if (this.isJsonLight) { this.metadataParameterValue = ParseMetadataParameterForJsonLight(rawParameterValue); this.metadataParameterValueForTypeNames = this.metadataParameterValue; } else { Debug.Assert(rawParameterValue == null || rawParameterValue == "verbose", "Only JSON-Light allows the the amount of metadata to be controlled."); this.metadataParameterValue = MetadataParameterValue.Full; this.metadataParameterValueForTypeNames = MetadataParameterValue.Minimal; } }