Exemplo n.º 1
0
        public static void Serialize(ErrorBatch entity, Stream requestStream)
        {
            var serializer = new JsonSerializer <ErrorBatch>();

            using (var textWriter = new StreamWriter(requestStream))
            {
                serializer.SerializeToWriter(entity, textWriter);
            }
        }
Exemplo n.º 2
0
        protected virtual void Send(ErrorBatch errors)
        {
            var request = CreateRequest();

            using (var requestStream = request.GetRequestStream())
            {
                ErrorBatchSerializer.Serialize(errors, requestStream);
            }
            try
            {
                using (request.GetResponse())
                {
                    OnBatchDelivered(new ErrorBatchDeliveryInfo(errors));
                }
            }
            catch (WebException ex)
            {
                OnBatchDelivered(new ErrorBatchDeliveryInfo(errors, ex.HandleWebException()));
            }
        }
Exemplo n.º 3
0
 public ErrorBatchDeliveryInfo(ErrorBatch errorBatch)
 {
     ErrorBatch = errorBatch;
 }
Exemplo n.º 4
0
 public ErrorBatchDeliveryInfo(ErrorBatch errorBatch, Exception exception)
     : this(errorBatch)
 {
     Exception = exception;
 }
Exemplo n.º 5
0
        public static string Serialize(ErrorBatch entity)
        {
            var serializer = new JsonSerializer <ErrorBatch>();

            return(serializer.SerializeToString(entity));
        }