Esempio n. 1
0
 internal ODataJsonCollectionReader(ODataJsonInputContext jsonInputContext, IEdmTypeReference expectedItemTypeReference, IODataReaderWriterListener listener) : base(jsonInputContext, expectedItemTypeReference, listener)
 {
     this.jsonInputContext = jsonInputContext;
     this.jsonCollectionDeserializer = new ODataJsonCollectionDeserializer(jsonInputContext);
     if (!jsonInputContext.Model.IsUserModel())
     {
         throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonCollectionReader_ParsingWithoutMetadata);
     }
 }
 internal ODataJsonCollectionReader(ODataJsonInputContext jsonInputContext, IEdmTypeReference expectedItemTypeReference, IODataReaderWriterListener listener) : base(jsonInputContext, expectedItemTypeReference, listener)
 {
     this.jsonInputContext           = jsonInputContext;
     this.jsonCollectionDeserializer = new ODataJsonCollectionDeserializer(jsonInputContext);
     if (!jsonInputContext.Model.IsUserModel())
     {
         throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonCollectionReader_ParsingWithoutMetadata);
     }
 }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">The input to read the payload from.</param>
        /// <param name="expectedItemTypeReference">The expected type 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>
        internal ODataJsonCollectionReader(ODataJsonInputContext jsonInputContext, IEdmTypeReference expectedItemTypeReference, IODataReaderWriterListener listener)
            : base(jsonInputContext, expectedItemTypeReference, listener)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(jsonInputContext != null, "jsonInputContext != null");

            this.jsonInputContext           = jsonInputContext;
            this.jsonCollectionDeserializer = new ODataJsonCollectionDeserializer(jsonInputContext);

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