Beispiel #1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="inputContext">The input to read from.</param>
 /// <param name="expectedItemTypeReference">The expected type reference for the items in the collection.</param>
 /// <param name="listener">If not null, the reader will notify the implementer of the interface of relevant state changes in the reader.</param>
 protected ODataCollectionReaderCoreAsync(
     ODataInputContext inputContext,
     IEdmTypeReference expectedItemTypeReference,
     IODataReaderWriterListener listener)
     : base(inputContext, expectedItemTypeReference, listener)
 {
 }
Beispiel #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="inputContext">The input context to read from.</param>
        protected ODataDeserializer(ODataInputContext inputContext)
        {
            Debug.Assert(inputContext != null, "inputContext != null");

            this.inputContext    = inputContext;
            this.ReaderValidator = this.inputContext.MessageReaderSettings.Validator;
        }
Beispiel #3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="inputContext">The input to read the payload from.</param>
 /// <param name="readingResourceSet">true if the reader is created for reading a resource set; false when it is created for reading a resource.</param>
 /// <param name="readingDelta">true if the reader is created for reading expanded navigation property in delta response; false otherwise.</param>
 /// <param name="listener">If not null, the reader will notify the implementer of the interface of relevant state changes in the reader.</param>
 protected ODataReaderCoreAsync(
     ODataInputContext inputContext,
     bool readingResourceSet,
     bool readingDelta,
     IODataReaderWriterListener listener)
     : base(inputContext, readingResourceSet, readingDelta, listener)
 {
 }
Beispiel #4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="inputContext">The input context to read the content from.</param>
        /// <param name="synchronous">true if the reader is created for synchronous operation; false for asynchronous.</param>
        protected ODataBatchReader(ODataInputContext inputContext, bool synchronous)
        {
            Debug.Assert(inputContext != null, "inputContext != null");

            this.inputContext        = inputContext;
            this.container           = inputContext.Container;
            this.synchronous         = synchronous;
            this.PayloadUriConverter = new ODataBatchPayloadUriConverter(inputContext.PayloadUriConverter);
        }
Beispiel #5
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="inputContext">The input to read from.</param>
        /// <param name="operation">The operation import whose parameters are being read.</param>
        protected ODataParameterReaderCore(
            ODataInputContext inputContext,
            IEdmOperation operation)
        {
            this.inputContext = inputContext;
            this.operation    = operation;

            this.EnterScope(ODataParameterReaderState.Start, null, null);
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="inputContext">The input to read the payload from.</param>
        /// <param name="readingResourceSet">true if the reader is created for reading a resource set; false when it is created for reading a resource.</param>
        /// <param name="readingDelta">true if the reader is created for reading expanded navigation property in delta response; false otherwise.</param>
        /// <param name="listener">If not null, the reader will notify the implementer of the interface of relevant state changes in the reader.</param>
        protected ODataReaderCore(
            ODataInputContext inputContext,
            bool readingResourceSet,
            bool readingDelta,
            IODataReaderWriterListener listener)
        {
            Debug.Assert(inputContext != null, "inputContext != null");

            this.inputContext         = inputContext;
            this.readingResourceSet   = readingResourceSet;
            this.readingDelta         = readingDelta;
            this.listener             = listener;
            this.currentResourceDepth = 0;
            this.Version = inputContext.MessageReaderSettings.Version;
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="inputContext">The input to read from.</param>
        /// <param name="expectedItemTypeReference">The expected type reference for the items in the collection.</param>
        /// <param name="listener">If not null, the reader will notify the implementer of the interface of relevant state changes in the reader.</param>
        protected ODataCollectionReaderCore(
            ODataInputContext inputContext,
            IEdmTypeReference expectedItemTypeReference,
            IODataReaderWriterListener listener)
        {
            this.inputContext = inputContext;
            this.expectedItemTypeReference = expectedItemTypeReference;

            if (this.expectedItemTypeReference == null)
            {
                // NOTE: collections cannot specify a type name for the collection itself, so always passing null.
                this.collectionValidator = new CollectionWithoutExpectedTypeValidator(/*expectedItemTypeName*/ null);
            }

            this.listener = listener;
            this.EnterScope(ODataCollectionReaderState.Start, null);
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="inputContext">The input to read the payload from.</param>
        /// <param name="readingResourceSet">true if the reader is created for reading a resource set; false when it is created for reading a resource.</param>
        /// <param name="readingDelta">true if the reader is created for reading expanded navigation property in delta response; false otherwise.</param>
        /// <param name="listener">If not null, the reader will notify the implementer of the interface of relevant state changes in the reader.</param>
        protected ODataReaderCore(
            ODataInputContext inputContext,
            bool readingResourceSet,
            bool readingDelta,
            IODataReaderWriterListener listener)
        {
            Debug.Assert(inputContext != null, "inputContext != null");

            this.inputContext         = inputContext;
            this.readingResourceSet   = readingResourceSet;
            this.readingDelta         = readingDelta;
            this.listener             = listener;
            this.currentResourceDepth = 0;

            // create a collection validator when reading a top-level resource set and a user model is present
            if (this.readingResourceSet && this.inputContext.Model.IsUserModel())
            {
                this.resourceSetValidator = new ResourceSetWithoutExpectedTypeValidator();
            }
        }
Beispiel #9
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="inputContext">The input to read from.</param>
 /// <param name="operation">The operation whose parameters are being read.</param>
 protected ODataParameterReaderCoreAsync(
     ODataInputContext inputContext,
     IEdmOperation operation)
     : base(inputContext, operation)
 {
 }