/// <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)
 {
     DebugUtils.CheckNoExternalCallers();
     Debug.Assert(valueSerializer != null, "valueSerializer should not be null");
     Debug.Assert(valueSerializer.Version >= ODataVersion.V3, "This is a Json Light only class, version should never be below V3.");
     this.valueSerializer = valueSerializer;
     this.typeNameOracle  = typeNameOracle;
 }
예제 #2
0
 /// <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="ODataJsonLightValueSerializer"/> 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(ODataJsonLightValueSerializer 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.JsonLightOutputContext.ODataSimplifiedOptions.EnableWritingODataAnnotationWithoutPrefix, this.valueSerializer.MessageWriterSettings.Version);
     this.writerValidator = this.valueSerializer.MessageWriterSettings.Validator;
 }
예제 #4
0
 /// <summary>
 /// Constructs a <see cref="JsonLightInstanceAnnotationWriter"/> that can write a collection of <see cref="ODataInstanceAnnotation"/>.
 /// </summary>
 /// <param name="valueSerializer">The <see cref="ODataJsonLightValueSerializer"/> 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(ODataJsonLightValueSerializer 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             = this.valueSerializer.ODataAnnotationWriter;
     this.asynchronousJsonWriter            = this.valueSerializer.AsynchronousJsonWriter;
     this.asynchronousODataAnnotationWriter = this.valueSerializer.AsynchronousODataAnnotationWriter;
     this.writerValidator                   = this.valueSerializer.MessageWriterSettings.Validator;
 }
예제 #5
0
 /// <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;
 }