コード例 #1
0
        public void Initialize()
        {
            this.jsonWriter = new MockJsonWriter
            {
                WriteNameVerifier = name => { },
                WriteValueVerifier = str => { }
            };

            this.referencedModel = new EdmModel();
            model = TestUtils.WrapReferencedModelsToMainModel(referencedModel);

            // Version will be V3+ in production since it's JSON Light only
            this.valueWriter = new MockJsonLightValueSerializer(jsonWriter, model) { Settings = new ODataMessageWriterSettings { Version = ODataVersion.V4, ShouldIncludeAnnotation = ODataUtils.CreateAnnotationFilter("*") } };
            this.jsonLightInstanceAnnotationWriter = new JsonLightInstanceAnnotationWriter(this.valueWriter, new JsonMinimalMetadataTypeNameOracle());
        }
コード例 #2
0
        public void Initialize()
        {
            this.jsonWriter = new MockJsonWriter
            {
                WriteNameVerifier  = name => { },
                WriteValueVerifier = str => { }
            };

            this.referencedModel = new EdmModel();
            model = TestUtils.WrapReferencedModelsToMainModel(referencedModel);

            // Version will be V3+ in production since it's JSON Light only
            this.valueWriter = new MockJsonLightValueSerializer(jsonWriter, model)
            {
                Settings = new ODataMessageWriterSettings {
                    Version = ODataVersion.V4, ShouldIncludeAnnotation = ODataUtils.CreateAnnotationFilter("*")
                }
            };
            this.jsonLightInstanceAnnotationWriter = new JsonLightInstanceAnnotationWriter(this.valueWriter, new JsonMinimalMetadataTypeNameOracle());
        }