Beispiel #1
0
 public override T DeserializeFromStream <T>(Stream stream)
 {
     try
     {
         var obj = (T)NetSerializerFormat.Deserialize(typeof(T), stream);
         return(obj);
     }
     catch (Exception ex)
     {
         return((T)NetSerializerFormat.HandleException(ex, typeof(T)));
     }
 }
Beispiel #2
0
 public override void SerializeToStream(IRequest requestContext, object request, Stream stream)
 {
     if (request == null)
     {
         return;
     }
     try
     {
         NetSerializerFormat.Serialize(requestContext, request, stream);
     }
     catch (Exception ex)
     {
         NetSerializerFormat.HandleException(ex, request.GetType());
     }
 }