Beispiel #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">The input to read the payload from.</param>
        /// <param name="functionImport">The function import whose parameters are being read.</param>
        internal ODataJsonParameterReader(ODataJsonInputContext jsonInputContext, IEdmFunctionImport functionImport)
            : base(jsonInputContext, functionImport)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(jsonInputContext != null, "jsonInputContext != null");
            Debug.Assert(jsonInputContext.ReadingResponse == false, "jsonInputContext.ReadingResponse == false");

            this.jsonInputContext = jsonInputContext;
            this.jsonPropertyAndValueDeserializer = new ODataJsonPropertyAndValueDeserializer(jsonInputContext);
            Debug.Assert(this.jsonInputContext.Model.IsUserModel(), "this.jsonInputContext.Model.IsUserModel()");
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">The input to read the payload from.</param>
        /// <param name="functionImport">The function import whose parameters are being read.</param>
        internal ODataJsonParameterReader(ODataJsonInputContext jsonInputContext, IEdmFunctionImport functionImport)
            : base(jsonInputContext, functionImport)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(jsonInputContext != null, "jsonInputContext != null");
            Debug.Assert(jsonInputContext.ReadingResponse == false, "jsonInputContext.ReadingResponse == false");

            this.jsonInputContext = jsonInputContext;
            this.jsonPropertyAndValueDeserializer = new ODataJsonPropertyAndValueDeserializer(jsonInputContext);
            Debug.Assert(this.jsonInputContext.Model.IsUserModel(), "this.jsonInputContext.Model.IsUserModel()");
        }
        private ODataProperty ReadPropertyImplementation(IEdmTypeReference expectedPropertyTypeReference)
        {
            ODataJsonPropertyAndValueDeserializer deserializer = new ODataJsonPropertyAndValueDeserializer(this);

            return(deserializer.ReadTopLevelProperty(expectedPropertyTypeReference));
        }
Beispiel #4
0
 private ODataProperty ReadPropertyImplementation(IEdmTypeReference expectedPropertyTypeReference)
 {
     ODataJsonPropertyAndValueDeserializer deserializer = new ODataJsonPropertyAndValueDeserializer(this);
     return deserializer.ReadTopLevelProperty(expectedPropertyTypeReference);
 }
 internal static object ConvertFromComplexOrCollectionValue(string value, ODataVersion version, IEdmModel model, IEdmTypeReference typeReference)
 {
     object obj3;
     ODataMessageReaderSettings messageReaderSettings = new ODataMessageReaderSettings();
     using (StringReader reader = new StringReader(value))
     {
         using (ODataJsonInputContext context = new ODataJsonInputContext(ODataFormat.VerboseJson, reader, messageReaderSettings, version, false, true, model, null))
         {
             ODataJsonPropertyAndValueDeserializer deserializer = new ODataJsonPropertyAndValueDeserializer(context);
             deserializer.ReadPayloadStart(false);
             object obj2 = deserializer.ReadNonEntityValue(typeReference, null, null, true);
             deserializer.ReadPayloadEnd(false);
             obj3 = obj2;
         }
     }
     return obj3;
 }
 internal ODataJsonParameterReader(ODataJsonInputContext jsonInputContext, IEdmFunctionImport functionImport) : base(jsonInputContext, functionImport)
 {
     this.jsonInputContext = jsonInputContext;
     this.jsonPropertyAndValueDeserializer = new ODataJsonPropertyAndValueDeserializer(jsonInputContext);
 }
Beispiel #7
0
 internal ODataJsonParameterReader(ODataJsonInputContext jsonInputContext, IEdmFunctionImport functionImport) : base(jsonInputContext, functionImport)
 {
     this.jsonInputContext = jsonInputContext;
     this.jsonPropertyAndValueDeserializer = new ODataJsonPropertyAndValueDeserializer(jsonInputContext);
 }