public override Task <TResult> Parse(Stream stream) { return(Task.Factory.StartNew(() => { if (_jsonSerializer == null || stream == null) { throw new ArgumentNullException(); } return _jsonSerializer.Deserialize(stream); })); }
public object Deserialize(byte[] buffer, int offset, int length, ColumnTypeCode typeCode, IColumnInfo typeInfo) { return(_serializer.Deserialize(ProtocolVersion, buffer, offset, length, typeCode, typeInfo)); }
/// <summary> /// Deserialize a TSerialized to a TComplex async /// </summary> /// <typeparam name="TSerialized">The Serialized Type</typeparam> /// <typeparam name="TComplex">The Deserialized Type</typeparam> /// <param name="serializer">The Serializer instance</param> /// <param name="input">The TSerialized Input</param> /// <returns>The TComplex Output Task</returns> public static async Task <TComplex> DeserializeAsync <TComplex, TSerialized>(this IGenericSerializer <TSerialized> serializer, TSerialized input) { return(await Task.Run(() => { return serializer.Deserialize <TComplex>(input); }).ConfigureAwait(false)); }
public override Task <TResult> Parse(HttpServerResponse response) { Argument.NotNull(response, "Server response not present."); return(Task.Factory.StartNew(() => _serializer.Deserialize(response.Stream))); }