Beispiel #1
0
 internal ODataJsonReader(ODataJsonInputContext jsonInputContext, IEdmEntityType expectedEntityType, bool readingFeed, IODataReaderWriterListener listener) : base(jsonInputContext, expectedEntityType, readingFeed, listener)
 {
     this.jsonInputContext = jsonInputContext;
     this.jsonEntryAndFeedDeserializer = new ODataJsonEntryAndFeedDeserializer(jsonInputContext);
     if (!this.jsonInputContext.Model.IsUserModel())
     {
         throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonReader_ParsingWithoutMetadata);
     }
 }
Beispiel #2
0
 internal ODataJsonReader(ODataJsonInputContext jsonInputContext, IEdmEntityType expectedEntityType, bool readingFeed, IODataReaderWriterListener listener) : base(jsonInputContext, expectedEntityType, readingFeed, listener)
 {
     this.jsonInputContext             = jsonInputContext;
     this.jsonEntryAndFeedDeserializer = new ODataJsonEntryAndFeedDeserializer(jsonInputContext);
     if (!this.jsonInputContext.Model.IsUserModel())
     {
         throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonReader_ParsingWithoutMetadata);
     }
 }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">The input to read the payload from.</param>
        /// <param name="expectedEntityType">The expected entity type for the entry to be read (in case of entry reader) or entries in the feed to be read (in case of feed reader).</param>
        /// <param name="readingFeed">true if the reader is created for reading a feed; false when it is created for reading an entry.</param>
        /// <param name="listener">If not null, the Json reader will notify the implementer of the interface of relevant state changes in the Json reader.</param>
        internal ODataJsonReader(ODataJsonInputContext jsonInputContext, IEdmEntityType expectedEntityType, bool readingFeed, IODataReaderWriterListener listener)
            : base(jsonInputContext, expectedEntityType, readingFeed, listener)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(jsonInputContext != null, "jsonInputContext != null");

            this.jsonInputContext = jsonInputContext;
            this.jsonEntryAndFeedDeserializer = new ODataJsonEntryAndFeedDeserializer(jsonInputContext);

            if (!this.jsonInputContext.Model.IsUserModel())
            {
                throw new ODataException(o.Strings.ODataJsonReader_ParsingWithoutMetadata);
            }
        }