/// <summary> /// Constructs a <see cref="JsonLightInstanceAnnotationWriter"/> that can write a collection of <see cref="ODataInstanceAnnotation"/>. /// </summary> /// <param name="valueSerializer">The <see cref="IODataJsonLightValueSerializer"/> to use for writing values of instance annotations. /// The <see cref="IJsonWriter"/> that is also used internally will be acquired from the this instance.</param> /// <param name="typeNameOracle">The oracle to use to determine the type name to write for entries and values.</param> internal JsonLightInstanceAnnotationWriter(IODataJsonLightValueSerializer valueSerializer, JsonLightTypeNameOracle typeNameOracle) { Debug.Assert(valueSerializer != null, "valueSerializer should not be null"); this.valueSerializer = valueSerializer; this.typeNameOracle = typeNameOracle; this.jsonWriter = this.valueSerializer.JsonWriter; this.odataAnnotationWriter = new JsonLightODataAnnotationWriter(this.jsonWriter, valueSerializer.Settings.ODataSimplified); }
/// <summary> /// Constructs a <see cref="JsonLightInstanceAnnotationWriter"/> that can write a collection of <see cref="ODataInstanceAnnotation"/>. /// </summary> /// <param name="valueSerializer">The <see cref="IODataJsonLightValueSerializer"/> to use for writing values of instance annotations. /// The <see cref="IJsonWriter"/> that is also used internally will be acquired from the this instance.</param> /// <param name="typeNameOracle">The oracle to use to determine the type name to write for entries and values.</param> internal JsonLightInstanceAnnotationWriter(IODataJsonLightValueSerializer valueSerializer, JsonLightTypeNameOracle typeNameOracle) { Debug.Assert(valueSerializer != null, "valueSerializer should not be null"); this.valueSerializer = valueSerializer; this.typeNameOracle = typeNameOracle; }