/// <summary> /// Save the value of content into message section of a <see cref="ISharpBatchTracking"/> /// </summary> /// <param name="content">The content to save</param> /// <returns></returns> public Task ToTracking(string content) { ISharpBatchTrackingFactory trackingFactory = (ISharpBatchTrackingFactory)BatchContext.RequestServices.GetService(typeof(ISharpBatchTrackingFactory)); var responseToTracking = new ResponseToTrackingManager(trackingFactory, SessionId); return(responseToTracking.ToTracking(content)); }
/// <summary> /// Save the serialized value of content into message section of a <see cref="ISharpBatchTracking"/>, /// </summary> /// <param name="data">The content to save</param> /// <param name="serializer">The <see cref="IModelSerializer"/> to use to serialize data.</param> /// <returns></returns> public Task ToTracking(object data, IModelSerializer serializer) { ISharpBatchTrackingFactory trackingFactory = (ISharpBatchTrackingFactory)BatchContext.RequestServices.GetService(typeof(ISharpBatchTrackingFactory)); var responseToTracking = new ResponseToTrackingManager(trackingFactory, SessionId); return(responseToTracking.ToTracking(data, serializer)); }
public override void onExecuted(BatchExecutionContext context) { var response = context.ShareMessage.Get <IResponseObject>(); var sharpBatchTracking = (ISharpBatchTrackingFactory)context.RequestServices.GetService(typeof(ISharpBatchTrackingFactory)); var modelSerializer = (IModelSerializer)context.RequestServices.GetService(typeof(IModelSerializer)); var responseToTrackingManager = new ResponseToTrackingManager(sharpBatchTracking, modelSerializer, context.SessionId); responseToTrackingManager.ToTracking(response.Response); }