/// <summary> /// Initializes a new instance of the <see cref="JsonPayloadDeserializer"/> class. /// </summary> /// <param name="payloadConverter">Payload converter</param> /// <param name="payloadErrorDeserializer">Payload error deserializer</param> public JsonPayloadDeserializer(IJsonToPayloadElementConverter payloadConverter, IPayloadErrorDeserializer payloadErrorDeserializer) { ExceptionUtilities.CheckArgumentNotNull(payloadConverter, "payloadConverter"); ExceptionUtilities.CheckArgumentNotNull(payloadErrorDeserializer, "payloadErrorDeserializer"); this.payloadConverter = payloadConverter; this.payloadErrorDeserializer = payloadErrorDeserializer; }
/// <summary> /// Initializes a new instance of the <see cref="XmlPayloadDeserializer"/> class. /// </summary> /// <param name="payloadErrorDeserializer">Payload error deserializer</param> /// <param name="xmlConverter">The converter from an XML to a payload element representation.</param> public XmlPayloadDeserializer(IPayloadErrorDeserializer payloadErrorDeserializer, IXmlToPayloadElementConverter xmlConverter) { ExceptionUtilities.CheckArgumentNotNull(payloadErrorDeserializer, "payloadErrorDeserializer"); ExceptionUtilities.CheckArgumentNotNull(xmlConverter, "xmlConverter"); this.payloadErrorDeserializer = payloadErrorDeserializer; this.xmlConverter = xmlConverter; }
/// <summary> /// Initializes a new instance of the <see cref="XmlPayloadDeserializer"/> class. /// </summary> /// <param name="payloadErrorDeserializer">Payload error deserializer</param> /// <param name="xmlConverter">The converter from an XML to a payload element representation.</param> public XmlPayloadDeserializer(IPayloadErrorDeserializer payloadErrorDeserializer, IXmlToPayloadElementConverter xmlConverter) { ExceptionUtilities.CheckArgumentNotNull(payloadErrorDeserializer, "payloadErrorDeserializer"); ExceptionUtilities.CheckArgumentNotNull(xmlConverter, "xmlConverter"); this.payloadErrorDeserializer = payloadErrorDeserializer; this.xmlConverter = xmlConverter; }
/// <summary> /// Initializes a new instance of the <see cref="JsonPayloadDeserializer"/> class. /// </summary> /// <param name="payloadConverter">Payload converter</param> /// <param name="payloadErrorDeserializer">Payload error deserializer</param> public JsonPayloadDeserializer(IJsonToPayloadElementConverter payloadConverter, IPayloadErrorDeserializer payloadErrorDeserializer) { ExceptionUtilities.CheckArgumentNotNull(payloadConverter, "payloadConverter"); ExceptionUtilities.CheckArgumentNotNull(payloadErrorDeserializer, "payloadErrorDeserializer"); this.payloadConverter = payloadConverter; this.payloadErrorDeserializer = payloadErrorDeserializer; }
/// <summary> /// Deserializes the given HTTP payload a error payload using the default encoding or returns null /// </summary> /// <param name="deserializer">The deserializer to extend</param> /// <param name="serialized">Bytes of the Payload</param> /// <param name="errorPayload">Error payload that is found</param> /// <returns>True if it finds and error, false if not</returns> public static bool TryDeserializeErrorPayload(this IPayloadErrorDeserializer deserializer, byte[] serialized, out ODataPayloadElement errorPayload) { ExceptionUtilities.CheckArgumentNotNull(deserializer, "deserializer"); return(deserializer.TryDeserializeErrorPayload(serialized, null, out errorPayload)); }