/// <summary>
        /// Creates an <see cref="ODataWriter" /> to write an entry.
        /// </summary>
        /// <returns>The created writer.</returns>
        private ODataWriter CreateODataEntryWriterImplementation()
        {
            ODataJsonWriter odataJsonWriter = new ODataJsonWriter(this, false);

            this.outputInStreamErrorListener = odataJsonWriter;
            return(odataJsonWriter);
        }
        /// <summary>
        /// Creates an <see cref="ODataWriter" /> to write a feed.
        /// </summary>
        /// <param name="entitySet">The entity set we are going to write entities for.</param>
        /// <param name="entityType">The entity type for the entries in the feed to be written (or null if the entity set base type should be used).</param>
        /// <returns>The created writer.</returns>
        private ODataWriter CreateODataFeedWriterImplementation(IEdmEntitySetBase entitySet, IEdmEntityType entityType)
        {
            ODataAtomWriter atomWriter = new ODataAtomWriter(this, entitySet, entityType, /*writingFeed*/ true);

            this.outputInStreamErrorListener = atomWriter;
            return(atomWriter);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a concrete <see cref="ODataJsonLightBatchWriter" /> instance.
        /// </summary>
        /// <returns>The newly created batch writer.</returns>
        private ODataBatchWriter CreateODataBatchWriterImplementation()
        {
            ODataBatchWriter batchWriter = new ODataJsonLightBatchWriter(this);

            this.outputInStreamErrorListener = batchWriter;
            return(batchWriter);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Creates an <see cref="ODataCollectionWriter" /> to write a collection of primitive or complex values (as result of a service operation invocation).
        /// </summary>
        /// <param name="itemTypeReference">The item type of the collection being written or null if no metadata is available.</param>
        /// <returns>The created collection writer.</returns>
        private ODataCollectionWriter CreateODataCollectionWriterImplementation(IEdmTypeReference itemTypeReference)
        {
            ODataAtomCollectionWriter atomCollectionWriter = new ODataAtomCollectionWriter(this, itemTypeReference);

            this.outputInStreamErrorListener = atomCollectionWriter;
            return(atomCollectionWriter);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Creates an <see cref="ODataWriter" /> to write a resource.
        /// </summary>
        /// <param name="navigationSource">The navigation source we are going to write resource set for.</param>
        /// <param name="resourceType">The structured type for the items in the resource set to be written (or null if the entity set base type should be used).</param>
        /// <returns>The created writer.</returns>
        private ODataWriter CreateODataResourceWriterImplementation(IEdmNavigationSource navigationSource, IEdmStructuredType resourceType)
        {
            ODataJsonLightWriter odataJsonWriter = new ODataJsonLightWriter(this, navigationSource, resourceType, /*writingResourceSet*/ false);

            this.outputInStreamErrorListener = odataJsonWriter;
            return(odataJsonWriter);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Creates an <see cref="ODataParameterWriter" /> to write a parameter payload.
        /// </summary>
        /// <param name="operation">The operation whose parameters will be written.</param>
        /// <returns>The created parameter writer.</returns>
        private ODataParameterWriter CreateODataParameterWriterImplementation(IEdmOperation operation)
        {
            ODataJsonLightParameterWriter jsonLightParameterWriter = new ODataJsonLightParameterWriter(this, operation);

            this.outputInStreamErrorListener = jsonLightParameterWriter;
            return(jsonLightParameterWriter);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Creates an <see cref="ODataWriter" /> to write a resource set.
        /// </summary>
        /// <param name="entitySet">The entity set we are going to write entities for.</param>
        /// <param name="resourceType">The structured type for the items in the resource set to be written (or null if the entity set base type should be used).</param>
        /// <param name="writingParameter">true means writing a resource set into a uri operation parameter, false writing a resource set in other payloads.</param>
        /// <param name="writingDelta">true means writing a delta resource set.</param>
        /// <returns>The created writer.</returns>
        private ODataWriter CreateODataResourceSetWriterImplementation(IEdmEntitySetBase entitySet, IEdmStructuredType resourceType, bool writingParameter, bool writingDelta)
        {
            ODataJsonLightWriter odataJsonWriter = new ODataJsonLightWriter(this, entitySet, resourceType, /*writingResourceSet*/ true, writingParameter, writingDelta);

            this.outputInStreamErrorListener = odataJsonWriter;
            return(odataJsonWriter);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Creates an <see cref="ODataDeltaWriter" /> to write a delta response.
        /// </summary>
        /// <param name="entitySet">The entity set we are going to write entities for.</param>
        /// <param name="entityType">The entity type for the entries in the resource set to be written (or null if the entity set base type should be used).</param>
        /// <returns>The created writer.</returns>
        private ODataDeltaWriter CreateODataDeltaWriterImplementation(IEdmEntitySetBase entitySet, IEdmEntityType entityType)
        {
            ODataJsonLightDeltaWriter odataJsonDeltaWriter = new ODataJsonLightDeltaWriter(this, entitySet, entityType);

            this.outputInStreamErrorListener = odataJsonDeltaWriter;
            return(odataJsonDeltaWriter);
        }
Exemplo n.º 9
0
        private ODataCollectionWriter CreateODataCollectionWriterImplementation()
        {
            ODataAtomCollectionWriter writer = new ODataAtomCollectionWriter(this, null, null);

            this.outputInStreamErrorListener = writer;
            return(writer);
        }
Exemplo n.º 10
0
        private ODataWriter CreateODataEntryWriterImplementation()
        {
            ODataAtomWriter writer = new ODataAtomWriter(this, false);

            this.outputInStreamErrorListener = writer;
            return(writer);
        }
Exemplo n.º 11
0
 private ODataBatchWriter CreateODataBatchWriterImplementation(string batchBoundary)
 {
     this.encoding = this.encoding ?? MediaTypeUtils.EncodingUtf8NoPreamble;
     ODataBatchWriter writer = new ODataBatchWriter(this, batchBoundary);
     this.outputInStreamErrorListener = writer;
     return writer;
 }
Exemplo n.º 12
0
        /// <summary>
        /// Creates an <see cref="ODataParameterWriter" /> to write a parameter payload.
        /// </summary>
        /// <param name="functionImport">The function import whose parameters will be written.</param>
        /// <returns>The created parameter writer.</returns>
        private ODataParameterWriter CreateODataParameterWriterImplementation(IEdmFunctionImport functionImport)
        {
            ODataJsonParameterWriter jsonParameterWriter = new ODataJsonParameterWriter(this, functionImport);

            this.outputInStreamErrorListener = jsonParameterWriter;
            return(jsonParameterWriter);
        }
Exemplo n.º 13
0
        /// <summary>
        /// Creates an <see cref="ODataCollectionWriter" /> to write a collection of primitive or complex values (as result of a service operation invocation).
        /// </summary>
        /// <returns>The created collection writer.</returns>
        private ODataCollectionWriter CreateODataCollectionWriterImplementation()
        {
            ODataJsonCollectionWriter jsonCollectionWriter = new ODataJsonCollectionWriter(this, /*expectedItemType*/ null, /*listener*/ null);

            this.outputInStreamErrorListener = jsonCollectionWriter;
            return(jsonCollectionWriter);
        }
        /// <summary>
        /// Creates an <see cref="ODataWriter" /> to write an entry.
        /// </summary>
        /// <param name="navigationSource">The navigation source we are going to write entities for.</param>
        /// <param name="entityType">The entity type for the entries in the feed to be written (or null if the entity set base type should be used).</param>
        /// <returns>The created writer.</returns>
        private ODataWriter CreateODataEntryWriterImplementation(IEdmNavigationSource navigationSource, IEdmEntityType entityType)
        {
            ODataAtomWriter atomWriter = new ODataAtomWriter(this, navigationSource, entityType, /*writingFeed*/ false);

            this.outputInStreamErrorListener = atomWriter;
            return(atomWriter);
        }
Exemplo n.º 15
0
        private ODataWriter CreateODataFeedWriterImplementation()
        {
            ODataJsonWriter writer = new ODataJsonWriter(this, true);

            this.outputInStreamErrorListener = writer;
            return(writer);
        }
Exemplo n.º 16
0
        private ODataBatchWriter CreateODataBatchWriterImplementation(string batchBoundary)
        {
            this.encoding = this.encoding ?? MediaTypeUtils.EncodingUtf8NoPreamble;
            ODataBatchWriter writer = new ODataBatchWriter(this, batchBoundary);

            this.outputInStreamErrorListener = writer;
            return(writer);
        }
Exemplo n.º 17
0
 /// <summary>
 /// Creates an async writer.
 /// </summary>
 /// <returns>The newly created async writer.</returns>
 private ODataAsynchronousWriter CreateODataAsynchronousWriterImplementation()
 {
     // Async writer needs the default encoding to not use the preamble.
     this.encoding = this.encoding ?? MediaTypeUtils.EncodingUtf8NoPreamble;
     ODataAsynchronousWriter asyncWriter = new ODataAsynchronousWriter(this);
     this.outputInStreamErrorListener = asyncWriter;
     return asyncWriter;
 }
Exemplo n.º 18
0
        /// <summary>
        /// Creates a batch writer.
        /// </summary>
        /// <param name="batchBoundary">The boundary string for the batch structure itself.</param>
        /// <returns>The newly created batch writer.</returns>
        private ODataBatchWriter CreateODataBatchWriterImplementation(string batchBoundary)
        {
            // Batch writer needs the default encoding to not use the preamble.
            this.encoding = this.encoding ?? MediaTypeUtils.EncodingUtf8NoPreamble;
            ODataBatchWriter batchWriter = new ODataBatchWriter(this, batchBoundary);

            this.outputInStreamErrorListener = batchWriter;
            return(batchWriter);
        }
Exemplo n.º 19
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonLightOutputContext">The output context to write to.</param>
        /// <param name="navigationSource">The navigation source we are going to write entities for.</param>
        /// <param name="entityType">The entity type for the entries in the resource set to be written (or null if the entity set base type should be used).</param>
        public ODataJsonLightDeltaWriter(ODataJsonLightOutputContext jsonLightOutputContext, IEdmNavigationSource navigationSource, IEdmEntityType entityType)
        {
            Debug.Assert(jsonLightOutputContext != null, "jsonLightOutputContext != null");

            this.navigationSource       = navigationSource;
            this.entityType             = entityType;
            this.jsonLightOutputContext = jsonLightOutputContext;
            this.resourceWriter         = new ODataJsonLightWriter(jsonLightOutputContext, navigationSource, entityType, true, writingDelta: true);
            this.inStreamErrorListener  = resourceWriter;
        }
Exemplo n.º 20
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonLightOutputContext">The output context to write to.</param>
        /// <param name="navigationSource">The navigation source we are going to write entities for.</param>
        /// <param name="entityType">The entity type for the entries in the resource set to be written (or null if the entity set base type should be used).</param>
        public ODataJsonLightDeltaWriter(ODataJsonLightOutputContext jsonLightOutputContext, IEdmNavigationSource navigationSource, IEdmEntityType entityType)
        {
            Debug.Assert(jsonLightOutputContext != null, "jsonLightOutputContext != null");

            // TODO: Replace the assertion with ODataException.
            Debug.Assert(jsonLightOutputContext.WritingResponse, "jsonLightOutputContext.WritingResponse is true");

            this.navigationSource       = navigationSource;
            this.entityType             = entityType;
            this.jsonLightOutputContext = jsonLightOutputContext;
            this.resourceWriter         = new ODataJsonLightWriter(jsonLightOutputContext, navigationSource, entityType, true, writingDelta: true);
            this.inStreamErrorListener  = resourceWriter;
        }
Exemplo n.º 21
0
 /// <summary>
 /// Creates an <see cref="ODataCollectionWriter" /> to write a collection of primitive or complex values (as result of a service operation invocation).
 /// </summary>
 /// <returns>The created collection writer.</returns>
 private ODataCollectionWriter CreateODataCollectionWriterImplementation()
 {
     ODataAtomCollectionWriter atomCollectionWriter = new ODataAtomCollectionWriter(this, /*expectedItemType*/ null, /*listener*/ null);
     this.outputInStreamErrorListener = atomCollectionWriter;
     return atomCollectionWriter;
 }
Exemplo n.º 22
0
 /// <summary>
 /// Creates an <see cref="ODataWriter" /> to write an entry.
 /// </summary>
 /// <returns>The created writer.</returns>
 private ODataWriter CreateODataEntryWriterImplementation()
 {
     ODataAtomWriter atomWriter = new ODataAtomWriter(this, false);
     this.outputInStreamErrorListener = atomWriter;
     return atomWriter;
 }
Exemplo n.º 23
0
 /// <summary>
 /// Creates an async writer.
 /// </summary>
 /// <returns>The newly created async writer.</returns>
 private ODataAsynchronousWriter CreateODataAsynchronousWriterImplementation()
 {
     // Async writer needs the default encoding to not use the preamble.
     this.encoding = this.encoding ?? MediaTypeUtils.EncodingUtf8NoPreamble;
     ODataAsynchronousWriter asyncWriter = new ODataAsynchronousWriter(this);
     this.outputInStreamErrorListener = asyncWriter;
     return asyncWriter;
 }
Exemplo n.º 24
0
 /// <summary>
 /// Creates an <see cref="ODataWriter" /> to write an entry.
 /// </summary>
 /// <param name="navigationSource">The navigation source we are going to write entities for.</param>
 /// <param name="entityType">The entity type for the entries in the feed to be written (or null if the entity set base type should be used).</param>
 /// <returns>The created writer.</returns>
 private ODataWriter CreateODataEntryWriterImplementation(IEdmNavigationSource navigationSource, IEdmEntityType entityType)
 {
     ODataAtomWriter atomWriter = new ODataAtomWriter(this, navigationSource, entityType, /*writingFeed*/false);
     this.outputInStreamErrorListener = atomWriter;
     return atomWriter;
 }
Exemplo n.º 25
0
 /// <summary>
 /// Creates an <see cref="ODataCollectionWriter" /> to write a collection of primitive or complex values (as result of a service operation invocation).
 /// </summary>
 /// <param name="itemTypeReference">The item type of the collection being written or null if no metadata is available.</param>
 /// <returns>The created collection writer.</returns>
 private ODataCollectionWriter CreateODataCollectionWriterImplementation(IEdmTypeReference itemTypeReference)
 {
     ODataAtomCollectionWriter atomCollectionWriter = new ODataAtomCollectionWriter(this, itemTypeReference);
     this.outputInStreamErrorListener = atomCollectionWriter;
     return atomCollectionWriter;
 }
Exemplo n.º 26
0
 /// <summary>
 /// Creates a batch writer.
 /// </summary>
 /// <param name="batchBoundary">The boundary string for the batch structure itself.</param>
 /// <returns>The newly created batch writer.</returns>
 private ODataBatchWriter CreateODataBatchWriterImplementation(string batchBoundary)
 {
     // Batch writer needs the default encoding to not use the preamble.
     this.encoding = this.encoding ?? MediaTypeUtils.EncodingUtf8NoPreamble;
     ODataBatchWriter batchWriter = new ODataBatchWriter(this, batchBoundary);
     this.outputInStreamErrorListener = batchWriter;
     return batchWriter;
 }
Exemplo n.º 27
0
 /// <summary>
 /// Creates an <see cref="ODataWriter" /> to write a feed.
 /// </summary>
 /// <param name="entitySet">The entity set we are going to write entities for.</param>
 /// <param name="entityType">The entity type for the entries in the feed to be written (or null if the entity set base type should be used).</param>
 /// <returns>The created writer.</returns>
 private ODataWriter CreateODataFeedWriterImplementation(IEdmEntitySetBase entitySet, IEdmEntityType entityType)
 {
     ODataAtomWriter atomWriter = new ODataAtomWriter(this, entitySet, entityType, /*writingFeed*/true);
     this.outputInStreamErrorListener = atomWriter;
     return atomWriter;
 }
Exemplo n.º 28
0
 private ODataWriter CreateODataEntryWriterImplementation()
 {
     ODataJsonWriter writer = new ODataJsonWriter(this, false);
     this.outputInStreamErrorListener = writer;
     return writer;
 }
Exemplo n.º 29
0
 private ODataCollectionWriter CreateODataCollectionWriterImplementation()
 {
     ODataJsonCollectionWriter writer = new ODataJsonCollectionWriter(this, null, null);
     this.outputInStreamErrorListener = writer;
     return writer;
 }
Exemplo n.º 30
0
 private ODataParameterWriter CreateODataParameterWriterImplementation(IEdmFunctionImport functionImport)
 {
     ODataJsonParameterWriter writer = new ODataJsonParameterWriter(this, functionImport);
     this.outputInStreamErrorListener = writer;
     return writer;
 }
Exemplo n.º 31
0
 private ODataWriter CreateODataFeedWriterImplementation()
 {
     ODataAtomWriter writer = new ODataAtomWriter(this, true);
     this.outputInStreamErrorListener = writer;
     return writer;
 }
Exemplo n.º 32
0
 /// <summary>
 /// Creates an <see cref="ODataWriter" /> to write a feed.
 /// </summary>
 /// <returns>The created writer.</returns>
 private ODataWriter CreateODataFeedWriterImplementation()
 {
     ODataJsonWriter odataJsonWriter = new ODataJsonWriter(this, true);
     this.outputInStreamErrorListener = odataJsonWriter;
     return odataJsonWriter;
 }