コード例 #1
0
        public override Task <TResult> Parse(Stream stream)
        {
            return(Task.Factory.StartNew(() =>
            {
                if (_jsonSerializer == null || stream == null)
                {
                    throw new ArgumentNullException();
                }

                return _jsonSerializer.Deserialize(stream);
            }));
        }
コード例 #2
0
ファイル: Serializer.cs プロジェクト: uzbekdev1/csharp-driver
 public object Deserialize(byte[] buffer, int offset, int length, ColumnTypeCode typeCode, IColumnInfo typeInfo)
 {
     return(_serializer.Deserialize(ProtocolVersion, buffer, offset, length, typeCode, typeInfo));
 }
コード例 #3
0
 /// <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));
 }
コード例 #4
0
        public override Task <TResult> Parse(HttpServerResponse response)
        {
            Argument.NotNull(response, "Server response not present.");

            return(Task.Factory.StartNew(() => _serializer.Deserialize(response.Stream)));
        }