public static void Serialize(ErrorBatch entity, Stream requestStream) { var serializer = new JsonSerializer <ErrorBatch>(); using (var textWriter = new StreamWriter(requestStream)) { serializer.SerializeToWriter(entity, textWriter); } }
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())); } }
public ErrorBatchDeliveryInfo(ErrorBatch errorBatch) { ErrorBatch = errorBatch; }
public ErrorBatchDeliveryInfo(ErrorBatch errorBatch, Exception exception) : this(errorBatch) { Exception = exception; }
public static string Serialize(ErrorBatch entity) { var serializer = new JsonSerializer <ErrorBatch>(); return(serializer.SerializeToString(entity)); }